#
# Commit all changes, export the release, make a release tar.
#
+. ./functions
+
cwd=`pwd`
reltype=release
tagbase=Release-
base_pkg=bacula
remote=$2
branch=$3
+ver=$4
-if [ $# != 3 ] ; then
- echo "Need $0 <bacula-source-directory> <remote-name> <branch>"
- echo "e.g. $0 rescue-source bee Branch-4.0"
+if [ $# != 4 ] ; then
+ echo "Need $0 <bacula-source-directory> <remote-name> <branch> <version>"
+ echo "e.g. $0 rescue-source bee Branch-4.0 4.0.1"
exit 1
fi
-cd $1
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
-cd bacula
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
+cd $1/bacula
+check_return_code "$0: Directory $1/bacula does not exist"
+src=$1/bacula
+
current=`git branch | awk '/*/ { print $2 }'`
src=`pwd`
git checkout ${branch}
-if [ $? -ne 0 ]; then
- echo "Checkout of branch ${branch} in ${src} failed."
- exit 1
-fi
+check_return_code "$0: Checkout of branch ${branch} in ${src} failed."
+
git pull ${remote} ${branch}
-ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' src/version.h`
fulltag=$tagbase$ver
echo " "
-echo "Making $reltype for Windows $base_pkg-$ver ..."
+echo "$0: Making $reltype for Windows $base_pkg-$ver ..."
echo " "
echo "OK? ctl-c to stop"
read a
cd ${src}
# get back to original branch
git checkout ${current}
+exit 0