]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/setup
ebl fix shell case..esac default condition
[bacula/bacula] / regress / scripts / setup
index 8ef7b8834739d9fc5de897c2db2c3100a63c7555..4a6e81b2c9c37b7677cd01d9074612d19e7696ad 100755 (executable)
@@ -2,38 +2,59 @@
 #
 # 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 [ $# != 3 ] ; then
-   echo "Incorrect number of arguments. Got $#. Need:"
-   echo "setup bacula-src email-address --with-DBNAME"
-   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
-cp -rp $1 build
+echo "Copying source from ${BACULA_SOURCE}"
+cp -rp ${BACULA_SOURCE} build
+scripts/create_sed
+sed -f tmp/sed_tmp scripts/regress-config.in >scripts/regress-config
+chmod 755 scripts/regress-config
 cp scripts/regress-config build
 cd build
 rm -f Makefile config.cache
 # Run Bacula configuration, make, install
-./regress-config ${cwd} $2 $3
-make
+./regress-config ${cwd}
+check_exit_code
+# Cleanup any win32 build in source
+cd src/win32
+make clean
+cd ../..
+make -j3
+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
+echo "Running database creation scripts"
 ./create_bacula_database
 ./drop_bacula_tables
 ./make_bacula_tables
 ./grant_bacula_privileges
-cd ..
+cd ${cwd}
 # Start and stop Bacula to ensure conf files are OK
 bin/bacula start
 bin/bacula stop