diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-30 23:24:45 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-30 23:24:45 +0200 |
commit | 1c3c90d0d4cfcba7c144b149210e9d914f9244d6 (patch) | |
tree | b0c7ba77999288a5393c065882ed9b4d976bdaa9 /scripts/functions | |
parent | 0c733700231da13aa12f7e0c26bee356f5bd846e (diff) | |
download | crosstool-ng-1c3c90d0d4cfcba7c144b149210e9d914f9244d6.tar.gz crosstool-ng-1c3c90d0d4cfcba7c144b149210e9d914f9244d6.tar.bz2 crosstool-ng-1c3c90d0d4cfcba7c144b149210e9d914f9244d6.zip |
scripts/functions: do not abort on failed extract
For glibc/eglibc, if the add-on can not be extracted, we want to catch
the error to print a meaningful error message.
So:
- try to extract the tarball
- if it fails, print a waring 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 extract procedure! :-)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions index f944eac6..9fc7b735 100644 --- a/scripts/functions +++ b/scripts/functions @@ -700,7 +700,8 @@ CT_Extract() { shift if ! ext="$(CT_GetFileExtension "${basename}")"; then - CT_Abort "'${basename}' not found in '${CT_TARBALLS_DIR}'" + CT_DoLog WARN "'${basename}' not found in '${CT_TARBALLS_DIR}'" + return 1 fi local full_file="${CT_TARBALLS_DIR}/${basename}${ext}" @@ -728,7 +729,9 @@ CT_Extract() { .tar.gz|.tgz) CT_DoExecLog FILE tar xvzf "${full_file}";; .tar) CT_DoExecLog FILE tar xvf "${full_file}";; /.git) CT_ExtractGit "${basename}" "${@}";; - *) CT_Abort "Don't know how to handle '${basename}${ext}': unknown extension";; + *) CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension" + return 1 + ;; esac # Don't mark as being extracted for git |