From 4c1666134b7c5d14c6eeb5bb0a3bf17842d1cde8 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 26 Aug 2011 00:07:51 +0200 Subject: configure: xz-utils alone can also handle LZMA-compressed tarballs Signed-off-by: "Yann E. MORIN" --- scripts/functions | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/functions b/scripts/functions index d2b45cfd..9a4b186a 100644 --- a/scripts/functions +++ b/scripts/functions @@ -403,7 +403,8 @@ CT_DoListTarballExt() { if [ "${CT_CONFIGURE_has_xzutils}" = "y" ]; then printf ".tar.xz\n" fi - if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then + if [ "${CT_CONFIGURE_has_lzma}" = "y" \ + -o "${CT_CONFIGURE_has_xzutils}" = "y" ]; then printf ".tar.lzma\n" fi printf ".tar.bz2\n" @@ -717,6 +718,7 @@ CT_Extract() { local nochdir="$1" local basename local ext + local lzma_prog local -a tar_opts if [ "${nochdir}" = "nochdir" ]; then @@ -758,9 +760,20 @@ CT_Extract() { tar_opts=( "--strip-components=1" ) tar_opts+=( "-C" "${basename}" ) tar_opts+=( "-xv" ) + + # One note here: + # - lzma can be handled either with 'xz' or 'lzma' + # - we get lzma tarball only if either or both are available + # - 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 + else + lzma_prog=xz + 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 -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) CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";; -- cgit v1.2.3