From 0c733700231da13aa12f7e0c26bee356f5bd846e Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 30 May 2011 23:24:11 +0200 Subject: scripts/functions: do not abort on failed download In case of glibc/eglibc, some add-ons that were previously external are now internal (bundled with the main sources). So we do not want to fail if an add-on tarball can't be downloaded; we want to post-pone the check until we can extract the main archive. So: - try to download the tarball - if it fails, print a warning instead of calling CT_Abort - return 1 So, components that want to catch the error and want to handle it can, while components that do not will gracefuly fail thanks to our catching every errors. Bonus: it works without changing any existing retrieval procedure! :-) Signed-off-by: "Yann E. MORIN" diff --git a/scripts/functions b/scripts/functions index 94bca81..f944eac 100644 --- a/scripts/functions +++ b/scripts/functions @@ -426,7 +426,7 @@ CT_GetFileExtension() { # to find the requested URL (think about snapshots, different layouts # for different gcc versions, etc...). CT_DoGetFile() { - local dest="${1##*/}" + local dest="${1}" local tmp="${dest}.tmp-dl" # OK, just look if we have them... # We are sure at least one is available, ./configure checked for it. @@ -530,7 +530,6 @@ CT_GetFile() { # Try to retrieve the file CT_DoLog EXTRA "Retrieving '${file}'" - CT_Pushd "${CT_TARBALLS_DIR}" URLS="$@" @@ -558,16 +557,18 @@ CT_GetFile() { for url in ${URLS}; do CT_DoLog DEBUG "Trying '${url}/${file}${ext}'" CT_DoGetFile "${url}/${file}${ext}" - if [ -f "${file}${ext}" ]; then + if [ -f "${CT_TARBALLS_DIR}/${file}${ext}" ]; then CT_DoLog DEBUG "Got '${file}' from the Internet" CT_SaveLocal "${CT_TARBALLS_DIR}/${file}${ext}" return 0 fi done done - CT_Popd - CT_Abort "Could not retrieve '${file}'." + # Just warn, someone may want to catch and handle the error + # (eg. glibc/eglibc add-ons can be missing). + CT_DoLog WARN "Could not retrieve '${file}'." + return 1 } # Checkout from CVS, and build the associated tarball -- cgit v0.10.2-6-g49f6