summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaetan Nadon <memsize@videotron.ca>2013-10-14 15:51:25 -0400
committerGaetan Nadon <memsize@videotron.ca>2013-10-24 15:58:11 -0400
commit8600040bf361865850a1877a0c947441f34b8acf (patch)
tree5d585e8cab2a3b2bb34e99290d2ba2565d83a931
parentccdf461fb255d494be75797545588fd332754436 (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-xbuild.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 6c6deb0..538aeba 100755
--- a/build.sh
+++ b/build.sh
@@ -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