1.1 --- a/scripts/functions Thu Aug 25 18:30:18 2011 +0200
1.2 +++ b/scripts/functions Fri Aug 26 00:07:51 2011 +0200
1.3 @@ -403,7 +403,8 @@
1.4 if [ "${CT_CONFIGURE_has_xzutils}" = "y" ]; then
1.5 printf ".tar.xz\n"
1.6 fi
1.7 - if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then
1.8 + if [ "${CT_CONFIGURE_has_lzma}" = "y" \
1.9 + -o "${CT_CONFIGURE_has_xzutils}" = "y" ]; then
1.10 printf ".tar.lzma\n"
1.11 fi
1.12 printf ".tar.bz2\n"
1.13 @@ -717,6 +718,7 @@
1.14 local nochdir="$1"
1.15 local basename
1.16 local ext
1.17 + local lzma_prog
1.18 local -a tar_opts
1.19
1.20 if [ "${nochdir}" = "nochdir" ]; then
1.21 @@ -758,9 +760,20 @@
1.22 tar_opts=( "--strip-components=1" )
1.23 tar_opts+=( "-C" "${basename}" )
1.24 tar_opts+=( "-xv" )
1.25 +
1.26 + # One note here:
1.27 + # - lzma can be handled either with 'xz' or 'lzma'
1.28 + # - we get lzma tarball only if either or both are available
1.29 + # - so, if we get an lzma tarball, and either 'xz' or 'lzma' is
1.30 + # missing, we can assume the other is available
1.31 + if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then
1.32 + lzma_prog=lzma
1.33 + else
1.34 + lzma_prog=xz
1.35 + fi
1.36 case "${ext}" in
1.37 .tar.xz) CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=xz -f "${full_file}";;
1.38 - .tar.lzma) CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=lzma -f "${full_file}";;
1.39 + .tar.lzma) CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program="${lzma_prog}" -f "${full_file}";;
1.40 .tar.bz2) CT_DoExecLog FILE tar "${tar_opts[@]}" -j -f "${full_file}";;
1.41 .tar.gz|.tgz) CT_DoExecLog FILE tar "${tar_opts[@]}" -z -f "${full_file}";;
1.42 .tar) CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";;