Do dir changes in test_release.sh properly.

Record the root source dir at the beginning of the script
and use it when changing directories later.
1 files changed, 10 insertions(+), 13 deletions(-)

M tools/test_release.sh
M tools/test_release.sh +10 -13
@@ 19,23 19,20 @@ fi
 
 VERSION=$1
 
-TEMPDIR=`mktemp -d`
-INSTALL_DIR=`mktemp -d`
-
-echo Installing to $INSTALL_DIR
+TEMPDIR=`mktemp -d --suffix _ahvensrc`
+INSTALL_DIR=`mktemp -d --suffix _ahveninstall`
 
 cd $TEMPDIR || fail "cd to temp failed"
 tar zxvf $TARBALL || fail "tar $TARBALL failed"
 cd ahven-$VERSION || fail "cd to ahven-$VERSION failed"
-cd gnat_linux || fail "cd to gnat_linux failed"
-make prefix=$INSTALL_DIR || fail "make failed"
-make check || fail "make check failed"
-make check_xml || fail "make check_xml failed"
-make check_tap || fail "make check_tap failed"
-make docs prefix=$INSTALL_DIR || fail "make docs failed"
-# make control || fail "make control failed"
-make install prefix=$INSTALL_DIR || fail "make install failed"
-cd ../examples || fail "cd examples failed"
+ROOT_SRC_DIR=`pwd`
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR || fail "make failed"
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR check || fail "make check failed"
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR check_xml || fail "make check_xml failed"
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR check_tap || fail "make check_tap failed"
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR docs || fail "make docs failed"
+cd $ROOT_SRC_DIR/gnat_linux && make prefix=$INSTALL_DIR install || fail "make install failed"
+cd $ROOT_SRC_DIR/examples || fail "cd examples failed"
 export ADA_PROJECT_PATH=$INSTALL_DIR/lib/gnat
 gnatmake -Pexamples || fail "gnatmake -Pexamples failed"