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 <[email protected]>
---
 build.sh |    2 ++
 1 file changed, 2 insertions(+)

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
-- 
1.7.9.5

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to