From 20691bb4b28f07ab770f043a5126bdc7b63b42f9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 14 Oct 2008 09:27:25 +0200 Subject: [PATCH] Add support to use another tar(1) command than the one in base. A new variable may be used in templates, $tar_override_cmd. This accepts a full path to the binary, note that dependency must be added before using this. --HG-- extra : convert_revision : fc2a20d8e0104152d624d355e077e2b4219a1b73 --- xbps.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xbps.sh b/xbps.sh index b9fd80e0462..dcc292db740 100755 --- a/xbps.sh +++ b/xbps.sh @@ -255,7 +255,7 @@ reset_tmpl_vars() run_stuff_before_configure_cmd run_stuff_before_build_cmd \ run_stuff_before_install_cmd run_stuff_after_install_cmd \ make_install_target postinstall_helpers version \ - ignore_files \ + ignore_files tar_override_cmd \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE" @@ -332,6 +332,7 @@ extract_distfiles() local curfile= local cursufx= local lwrksrc= + local ltar_cmd= # # If we are being called via the target, just extract and return. @@ -358,6 +359,12 @@ extract_distfiles() echo "==> Extracting '$pkgname-$version' distfiles." + if [ -n "$tar_override_cmd" ]; then + ltar_cmd="$tar_override_cmd" + else + ltar_cmd="$tar_cmd" + fi + for f in ${distfiles}; do curfile=$(basename $f) cursufx=${curfile##*@} @@ -371,7 +378,7 @@ extract_distfiles() case ${cursufx} in .tar.bz2|.tar.gz|.tgz|.tbz) - $tar_cmd xfz $XBPS_SRCDISTDIR/$curfile -C $lwrksrc + $ltar_cmd xfz $XBPS_SRCDISTDIR/$curfile -C $lwrksrc if [ $? -ne 0 ]; then echo -n "*** ERROR extracting \`$curfile' into " echo "$lwrksrc ***" @@ -379,7 +386,7 @@ extract_distfiles() fi ;; .tar) - $tar_cmd xf $XBPS_SRCDISTDIR/$curfile -C $lwrksrc + $ltar_cmd xf $XBPS_SRCDISTDIR/$curfile -C $lwrksrc if [ $? -ne 0 ]; then echo -n "*** ERROR extracting \`$curfile' into " echo "$lwrksrc ***"