summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-08-25 22:07:51 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-08-25 22:07:51 (GMT)
commit4c1666134b7c5d14c6eeb5bb0a3bf17842d1cde8 (patch)
tree3163c2e19da19f0961a9292f504876cc3cc78569 /scripts
parent04250cc896d00b28ba518ece4e2eae7b9b0bb048 (diff)
configure: xz-utils alone can also handle LZMA-compressed tarballs
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions
index d2b45cf..9a4b186 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}";;