]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/setup
Delete unwanted subdirectory
[bacula/bacula] / regress / scripts / setup
index 83b118af2288f4d3ed00d006db512eaf81dc8a3e..8292d8717fa612e4bdfced7717210a8224b6f768 100755 (executable)
@@ -2,43 +2,55 @@
 #
 # Script to setup running Bacula regression tests
 #
+
+check_exit_code()
+{
+   if [ $? != 0 ] ; then
+      echo "Bad exit code giving up"
+      exit 1 
+   fi
+}
+
+. ./config
+
 cwd=`pwd`
-if [ $# != 4 ] ; then
-   echo "Incorrect number of arguments. Got $#. Need:"
-   echo "setup bacula-src email-address --with-DBNAME --with-tcp-wrappers"
-   echo " "
-   exit 1
-fi
-if [ ! -d $1 ] ; then
-   echo "Arg 1 must be a Bacula release directory."
+if [ ! -d ${BACULA_SOURCE} ] ; then
+   echo "The BACULA_SOURCE environment variable must be a Bacula release directory, but is not."
    echo " "
    exit 1
 fi
 rm -rf build bin
 # Copy new source
-echo "Copying source from $1"
-cp -rp $1 build
+echo "Copying source from ${BACULA_SOURCE}"
+cp -rp ${BACULA_SOURCE} build
 cp scripts/regress-config build
 cd build
 rm -f Makefile config.cache
-# Remove files that may be too big
-cd doc/latex
+# Run Bacula configuration, make, install
+./regress-config ${cwd}
+check_exit_code
+# Cleanup any win32 build in source
+cd src/win32
 make clean
 cd ../..
-# Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3 $4
 make
+check_exit_code
 make install
+check_exit_code
 cp src/tools/testls ../bin
+check_exit_code
 
-cd ..
+cd ${cwd}
 bin/bacula stop
+
+mkdir -p working
 cd bin
-./create_bacula_database
-./drop_bacula_tables
+echo "Running database creation scripts"
+./create_bacula_database bacula
+./drop_bacula_tables bacula
 ./make_bacula_tables
-./grant_bacula_privileges
-cd ..
+./grant_bacula_privileges bacula
+cd ${cwd}
 # Start and stop Bacula to ensure conf files are OK
 bin/bacula start
 bin/bacula stop