#
# Make full release
#
+. ./functions
+
# Bacula git repos
-bacula=${bacula:-${HOME}/bacula/k/bacula}
-docs=${docs:-${HOME}/bacula/k/docs}
-rescue=${rescue:-${HOME}/bacula/k/rescue}
+bacula=${bacula:-${HOME}/bacula/k}
+docs=${docs:-${HOME}/bacula/docs}
+rescue=${rescue:-${HOME}/bacula/rescue}
#
# Set the following to your remote name. By default it is origin.
+# NOTE!!! There is a different remote set on rescue below
remote=bs
-export push=yes
#
# Note, you will probably want to set updatepo=no if you
# run this script multiple times for a given release.
export updatepo=no
+export push=yes
+
if [ $# != 1 ] ; then
echo "Need $0 <Branch-to-release>"
branch=$1
+cwd=`pwd`
+
+# We pull the version $ver from the main bacula source directory
+cd $bacula/bacula
+check_return_code "makeall: Directory $bacula/bacula does not exist"
+
+current=`git branch | awk '/*/ { print $2 }'`
+git checkout ${branch}
+check_return_code "makeall: Checkout of branch ${branch} failed."
+
+git pull ${remote} ${branch}
+ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' src/version.h`
+git checkout ${current}
+cd $cwd
+
# ./makeclean
-./makebacularel $bacula $remote $branch
-./makedocsrel $bacula $docs $remote $branch
-./makerescuerel $rescue $remote $branch
-./makewinrel $bacula $remote $branch | tee win$$.log
+./makebacularel $bacula $remote $branch $ver
+check_return_code "$0: makebacularel bad return code"
+
+./makedocsrel $bacula $docs $remote $branch $ver
+check_return_code "$0: makedocsrel bad return code"
+
+
+./makewinrel $bacula $remote $branch $ver | tee win$$.log
+check_return_code "$0: makewinrel bad return code"
# strip ./configure strerror from Win log file
sed -i -e 's%strerror%%' win$$.log
# check for warning and error messages
grep -i warning win$$.log >/dev/null
-if [ $? -eq 0 ] ; then
- echo " "
- echo "Warnings in win$$.log"
- exit 1
-fi
+check_return_code "makeall: Warnings in win$$.log"
grep -i error win$$.log >/dev/null
-if [ $? -eq 0 ] ; then
- echo " "
- echo "Errors in win$$.log"
- exit 1
-fi
+check_return_code "makeall: Errors in win$$.log"
rm -f win$$.log
+
+remote=sf
+./makerescuerel $rescue $remote $branch $ver
+check_return_code "$0: makerescuerel bad return code"
+
+exit 0