# HG changeset patch # User "Yann E. MORIN" # Date 1314310071 -7200 # Node ID e5078db4bd2c612dfd4d43b7a12dd35bf6ae0fbc # Parent 9cb3554bebebb1d69429b2c293850176c8df3d61 configure: xz-utils alone can also handle LZMA-compressed tarballs Signed-off-by: "Yann E. MORIN" diff -r 9cb3554bebeb -r e5078db4bd2c configure --- a/configure Thu Aug 25 18:30:18 2011 +0200 +++ b/configure Fri Aug 26 00:07:51 2011 +0200 @@ -506,6 +506,7 @@ err="xz-compressed tarballs will not be used" has_or_warn prog=lzma \ kconfig=has_lzma \ + skip="${has_xzutils}" \ err="lzma-compressed tarballs will not be used" has_or_abort prog=readlink has_or_abort prog=objcopy var=objcopy diff -r 9cb3554bebeb -r e5078db4bd2c scripts/functions --- a/scripts/functions Thu Aug 25 18:30:18 2011 +0200 +++ b/scripts/functions Fri Aug 26 00:07:51 2011 +0200 @@ -403,7 +403,8 @@ 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 @@ local nochdir="$1" local basename local ext + local lzma_prog local -a tar_opts if [ "${nochdir}" = "nochdir" ]; then @@ -758,9 +760,20 @@ 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}";;