diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-30 23:24:11 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-30 23:24:11 +0200 |
commit | 0c733700231da13aa12f7e0c26bee356f5bd846e (patch) | |
tree | 5224177a94d4d53bd1a82e7977d8c000bd67e871 /scripts/functions | |
parent | b4620c66407f3739a80cdc93d701a2fbee8007c7 (diff) | |
download | crosstool-ng-0c733700231da13aa12f7e0c26bee356f5bd846e.tar.gz crosstool-ng-0c733700231da13aa12f7e0c26bee356f5bd846e.tar.bz2 crosstool-ng-0c733700231da13aa12f7e0c26bee356f5bd846e.zip |
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" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/functions b/scripts/functions index 94bca81a..f944eac6 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 |