diff options
author | Titus von Boxberg <titus@v9g.de> | 2011-11-22 09:08:10 (GMT) |
---|---|---|
committer | Titus von Boxberg <titus@v9g.de> | 2011-11-22 09:08:10 (GMT) |
commit | 421c5245328910343c82a61e364eeb7a439eb632 (patch) | |
tree | c007945290912adbbeb5c696c048e02b345e199f /scripts | |
parent | 02fb9df45a1cad68ed6eea91655e643d9f81fc68 (diff) |
scripts/functions: extract: portable call for old and defective tars
Instead of using -J, --lzma, --use-compress-program or the like
use <compressor> -dc <file> | tar -f -
Signed-off-by: Titus von Boxberg <titus@v9g.de>
(transplanted from 49af7802dcd538ec3cb64337030b03ac2c6344d2)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/functions | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/functions b/scripts/functions index 789b622..6990edd 100644 --- a/scripts/functions +++ b/scripts/functions @@ -761,15 +761,15 @@ CT_Extract() { # - so, if we get an lzma tarball, and either 'xz' or 'lzma' is # missing, we can assume the other is available if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then - lzma_prog=lzma + lzma_prog="lzma -fdc" else - lzma_prog=xz + lzma_prog="xz -fdc" fi case "${ext}" in - .tar.xz) CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=xz -f "${full_file}";; - .tar.lzma) CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program="${lzma_prog}" -f "${full_file}";; - .tar.bz2) CT_DoExecLog FILE tar "${tar_opts[@]}" -j -f "${full_file}";; - .tar.gz|.tgz) CT_DoExecLog FILE tar "${tar_opts[@]}" -z -f "${full_file}";; + .tar.xz) xz -fdc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; + .tar.lzma) ${lzma_prog} "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; + .tar.bz2) bzip2 -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; + .tar.gz|.tgz) gzip -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;; .tar) CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";; /.git) CT_ExtractGit "${basename}" "${@}";; *) CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension" |