# HG changeset patch # User "Yann E. MORIN" # Date 1306790651 -7200 # Node ID b6495ef0193cb2939e2390fce125c797d3ee19ec # Parent 667054325aab3b831edf763e840dc63dda7ab874 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 -r 667054325aab -r b6495ef0193c scripts/functions --- a/scripts/functions Tue May 31 01:30:54 2011 +0200 +++ b/scripts/functions Mon May 30 23:24:11 2011 +0200 @@ -426,7 +426,7 @@ # 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 @@ # Try to retrieve the file CT_DoLog EXTRA "Retrieving '${file}'" - CT_Pushd "${CT_TARBALLS_DIR}" URLS="$@" @@ -558,16 +557,18 @@ 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