diff options
author | Gaetan Nadon <memsize@videotron.ca> | 2013-10-14 15:51:25 -0400 |
---|---|---|
committer | Gaetan Nadon <memsize@videotron.ca> | 2013-10-24 15:58:11 -0400 |
commit | 8600040bf361865850a1877a0c947441f34b8acf (patch) | |
tree | 5d585e8cab2a3b2bb34e99290d2ba2565d83a931 | |
parent | ccdf461fb255d494be75797545588fd332754436 (diff) |
build.sh: recover SRCDIR when tar command fails
The SRCDIR is changed before running the tar command. If it fails,
the calling function attempts to cd to the directory the tar command
was not successful in creating.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
-rwxr-xr-x | build.sh | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -254,6 +254,7 @@ checkfortars() { for jj in bz2 gz xz; do TARFILE=`ls -1rt $ii${component:+/}$component-*.tar.$jj 2> /dev/null | tail -n 1` if [ X"$TARFILE" != X ]; then + old_srcdir=$SRCDIR SRCDIR=`echo $TARFILE | sed "s,.tar.$jj,,"` SRCDIR=`echo $SRCDIR | sed "s,MesaLib,Mesa,"` if [ ! -d $SRCDIR ]; then @@ -270,6 +271,7 @@ checkfortars() { esac tar $TAROPTS $TARFILE -C $ii if [ $? -ne 0 ]; then + SRCDIR=${old_srcdir} failed tar $module $component return 1 fi |