--- /dev/null
+#
+# Functions for the release scripts
+#
+check_return_code()
+{
+ if [ $? != 0 ]; then
+ echo " "
+ echo "$1"
+ echo " "
+ exit 1
+ fi
+}
#
# 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
#
# 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
+export updatepo=yes
+export push=no
if [ $# != 1 ] ; then
cwd=`pwd`
# We pull the version $ver from the main bacula source directory
-cd $bacula
+cd $bacula/bacula
+check_return_code "makeall: Directory $bacula/bacula does not exist"
+
current=`git branch | awk '/*/ { print $2 }'`
-cd bacula
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
git checkout ${branch}
+check_return_code "makeall: Checkout of branch ${branch} failed."
+
git pull ${remote} ${branch}
-if [ $? -ne 0 ]; then
- echo "Checkout of branch ${branch} failed."
- exit 1
-fi
ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' src/version.h`
git checkout ${current}
cd $cwd
-
# ./makeclean
./makebacularel $bacula $remote $branch $ver
+check_return_code "$0: makebacularel bad return code"
+
./makedocsrel $bacula $docs $remote $branch $ver
-./makerescuerel $rescue $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
# Commit all changes, update the language files,
# export the release, make a release tar.
#
+. ./functions
+
cwd=`pwd`
reltype=release
tagbase=Release-
exit 1
fi
cd $1
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
+check_return_code "$0: Directory $1 does not exist"
+cd bacula
+check_return_code "$0: Directory $1/bacula does not exist"
src=`pwd`
current=`git branch | awk '/*/ { print $2 }'`
-cd $base_dir
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
remote=$2
branch=$3
git checkout ${branch}
+check_return_code "$0: Checkout of branch ${branch} failed."
git pull ${remote} ${branch}
-if [ $? -ne 0 ]; then
- echo "Checkout of branch ${branch} failed."
- exit 1
-fi
fulltag=$tagbase$ver
echo " "
-echo "Making $reltype for $base_pkg-$ver ..."
+echo "$0: Making $reltype for $base_pkg-$ver ..."
echo " "
echo "OK? ctl-c to stop"
read a
cd ${src}
git commit -am "Final po changes for ${fulltag}"
fi
-git tag -d ${fulltag}
+git tag -d ${fulltag} 2>/dev/null 1>/dev/null
echo "Creating new tag -- $fulltag"
git tag $fulltag
if [ $? != 0 ] ; then
echo " "
- echo "Non-zero return status from Git"
+ echo "makebacularel: Non-zero return status from Git"
echo " "
exit 1
fi
git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
if [ $? != 0 ] ; then
echo " "
- echo "Non-zero return status from Git"
+ echo "makebacularel: Non-zero return status from Git"
echo " "
exit 1
fi
cd ${src}
git checkout ${current}
+exit 0
#
# Commit all changes, export the release, make a release tar.
#
+. ./functions
+
cwd=`pwd`
reltype=release
tagbase=Release-
echo "e.g. $0 bacula-source docs-source bee master 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
+
+# Get Bacula branch setup
+cd $1/bacula
+check_return_code "$0: Directory $1/bacula does not exist"
+
bcurrent=`git branch | awk '/*/ { print $2 }'`
git checkout ${branch}
-if [ $? -ne 0 ]; then
- echo "Checkout of branch ${branch} in $1/bacula failed."
- exit 1
-fi
+check_return_code "$0: Checkout of branch ${branch} in $1/bacula failed."
git pull ${remote} ${branch}
bsrc=`pwd`
cd ${cwd}
-cd $2
-if [ $? -ne 0 ]; then
- echo "Directory: $2 does not exist"
- exit 1
-fi
-cd $base_dir
-if [ $? -ne 0 ]; then
- echo "Directory: $2 does not exist"
- exit 1
-fi
+
+# Go to docs
+cd $2/$base_dir
+check_return_code "$0: Directory $2/$base_dir does not exist"
+
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}
fulltag=$tagbase$ver
echo " "
-echo "Making $reltype for $base_pkg-$ver ..."
+echo "$0: Making $reltype for $base_pkg-$ver ..."
echo " "
echo "OK? ctl-c to stop"
read a
-git tag -d ${fulltag}
+git tag -d ${fulltag} 2>/dev/null 1>/dev/null
echo "Creating new tag -- $fulltag"
git tag $fulltag
-if [ $? != 0 ] ; then
- echo " "
- echo "Non-zero return status from Git"
- echo " "
- exit 1
-fi
+check_return_code "$0: Non-zero return status from Git"
echo "Create Tag $fulltag done"
cd ${cwd}
rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
rm -rf $fulltag
cd ${src}
git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
-if [ $? != 0 ] ; then
- echo " "
- echo "Non-zero return status from Git"
- echo " "
- exit 1
-fi
+check_return_code "$0: Non-zero return status from Git"
echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
cd ${cwd}
tar xfz $base_pkg-$ver.tar.gz
cd ${bsrc}
git checkout ${bcurrent}
+exit 0
#
# Commit all changes, export the release, make a release tar.
#
+. ./functions
+
cwd=`pwd`
reltype=release
tagbase=Release-
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 $base_dir
-if [ $? -ne 0 ]; then
- echo "Directory: $1 does not exist"
- exit 1
-fi
+cd $1/rescue
+check_return_code "$0: Directory $1/rescue does not exist"
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}
fulltag=$tagbase$ver
echo " "
-echo "Making $reltype for $base_pkg-$ver ..."
+echo "$0: Making $reltype for $base_pkg-$ver ..."
echo " "
echo "OK? ctl-c to stop"
read a
-git tag -d ${fulltag}
+git tag -d ${fulltag} 2>/dev/null 1>/dev/null
echo "Creating new tag -- $fulltag"
git tag $fulltag
-if [ $? != 0 ] ; then
- echo " "
- echo "Non-zero return status from Git"
- echo " "
- exit 1
-fi
+check_return_code "$0: Non-zero return status from git tag"
echo "Create Tag $fulltag done"
cd ${cwd}
rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
rm -rf $fulltag
cd ${src}
git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
-if [ $? != 0 ] ; then
- echo " "
- echo "Non-zero return status from Git"
- echo " "
- exit 1
-fi
+check_return_code "$0: Non-zero return status from Git"
echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
if [ a$push != ano ]; then
cd ${src}
cd ${cwd}
./sign $base_pkg-$ver.tar.gz
ls -l $base_pkg-$ver.tar.*
+exit 0
#
# Commit all changes, export the release, make a release tar.
#
+. ./functions
+
cwd=`pwd`
reltype=release
tagbase=Release-
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}
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
#define TRACE_FILE 1
/* If this is set stdout will not be closed on startup */
-#define DEVELOPER 1
+/* #define DEVELOPER 1 */
/*
* SMCHECK does orphaned buffer checking (memory leaks)