From 1c3c90d0d4cfcba7c144b149210e9d914f9244d6 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 30 May 2011 23:24:45 +0200 Subject: 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" diff --git a/scripts/functions b/scripts/functions index f944eac..9fc7b73 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 -- cgit v0.10.2-6-g49f6