From eb073f653c52e912bd18ce7e3fbcb8fd36ec0a81 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 5 Aug 2010 12:25:44 +0200 Subject: [PATCH] Tweak get release version from main bacula directory --- bacula/release/makeall | 29 +++++++++++++++++++++++++---- bacula/release/makebacularel | 12 ++++++------ bacula/release/makedocsrel | 13 +++++++------ bacula/release/makerescuerel | 12 ++++++------ bacula/release/makewinrel | 8 ++++---- 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/bacula/release/makeall b/bacula/release/makeall index f4126ca997..7c7555cefb 100755 --- a/bacula/release/makeall +++ b/bacula/release/makeall @@ -24,11 +24,32 @@ fi branch=$1 +cwd=`pwd` + +# We pull the version $ver from the main bacula source directory +cd $bacula +current=`git branch | awk '/*/ { print $2 }'` +cd bacula +if [ $? -ne 0 ]; then + echo "Directory: $1 does not exist" + exit 1 +fi +git checkout ${branch} +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 -./makedocsrel $bacula $docs $remote $branch -./makerescuerel $rescue $remote $branch -./makewinrel $bacula $remote $branch | tee win$$.log +./makebacularel $bacula $remote $branch $ver +./makedocsrel $bacula $docs $remote $branch $ver +./makerescuerel $rescue $remote $branch $ver +./makewinrel $bacula $remote $branch $ver | tee win$$.log # strip ./configure strerror from Win log file sed -i -e 's%strerror%%' win$$.log diff --git a/bacula/release/makebacularel b/bacula/release/makebacularel index 2ca51a1676..713fc27492 100755 --- a/bacula/release/makebacularel +++ b/bacula/release/makebacularel @@ -17,9 +17,10 @@ reltype=release tagbase=Release- base_dir=bacula base_pkg=bacula -if [ $# != 3 ] ; then - echo "Need $0 " - echo "e.g. $0 release-source bee 4.0.0" +ver=$4 +if [ $# != 4 ] ; then + echo "Need $0 " + echo "e.g. $0 release-source bee 4.0 4.0.1" exit 1 fi cd $1 @@ -42,7 +43,6 @@ if [ $? -ne 0 ]; then echo "Checkout of branch ${branch} failed." exit 1 fi -ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' src/version.h` fulltag=$tagbase$ver echo " " echo "Making $reltype for $base_pkg-$ver ..." @@ -104,8 +104,8 @@ cd .. if [ a$push != ano ]; then cd ${src} git push ${remote} ${branch} - git push ${remote} tag ${fulltag} - echo "Pushed ${remote} and push tag ${fulltag}" +# git push ${remote} tag ${fulltag} + echo "Pushed ${remote}" fi cd ${src} diff --git a/bacula/release/makedocsrel b/bacula/release/makedocsrel index 38b9dd613f..db14612fdc 100755 --- a/bacula/release/makedocsrel +++ b/bacula/release/makedocsrel @@ -16,9 +16,11 @@ base_dir=docs base_pkg=bacula-$base_dir remote=$3 branch=$4 -if [ $# != 4 ] ; then - echo "Need $0 " - echo "e.g. $0 bacula-source docs-source bee master" +ver=$5 + +if [ $# != 5 ] ; then + echo "Need $0 " + echo "e.g. $0 bacula-source docs-source bee master 4.0.1" exit 1 fi cd $1 @@ -58,7 +60,6 @@ if [ $? -ne 0 ]; then exit 1 fi git pull ${remote} ${branch} -ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${bsrc}/src/version.h` fulltag=$tagbase$ver echo " " echo "Making $reltype for $base_pkg-$ver ..." @@ -107,8 +108,8 @@ ls -l $base_pkg-$ver.tar.* if [ a$push != ano ]; then cd ${src} git push ${remote} ${branch} - git push ${remote} tag ${fulltag} - echo "Pushed ${remote} and push tag ${fulltag}" +# git push ${remote} tag ${fulltag} + echo "Pushed ${remote}" fi cd ${src} diff --git a/bacula/release/makerescuerel b/bacula/release/makerescuerel index 69bb5e13ce..3406f00ad6 100755 --- a/bacula/release/makerescuerel +++ b/bacula/release/makerescuerel @@ -16,10 +16,11 @@ base_pkg=bacula-rescue base_dir=rescue remote=$2 branch=$3 +ver=$4 -if [ $# != 3 ] ; then - echo "Need $0 " - echo "e.g. $0 rescue-source bee Branch-4.0" +if [ $# != 4 ] ; then + echo "Need $0 " + echo "e.g. $0 rescue-source bee Branch-4.0 4.0.1" exit 1 fi cd $1 @@ -41,7 +42,6 @@ if [ $? -ne 0 ]; then exit 1 fi git pull ${remote} ${branch} -ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' version.h` fulltag=$tagbase$ver echo " " echo "Making $reltype for $base_pkg-$ver ..." @@ -74,8 +74,8 @@ echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz" if [ a$push != ano ]; then cd ${src} git push ${remote} ${branch} - git push ${remote} tag ${fulltag} - echo "Pushed ${remote} and push tag ${fulltag}" +# git push ${remote} tag ${fulltag} + echo "Pushed ${remote}" fi cd ${src} git checkout ${current} diff --git a/bacula/release/makewinrel b/bacula/release/makewinrel index 814183afba..ef1f1a63a6 100755 --- a/bacula/release/makewinrel +++ b/bacula/release/makewinrel @@ -15,10 +15,11 @@ tagbase=Release- base_pkg=bacula remote=$2 branch=$3 +ver=$4 -if [ $# != 3 ] ; then - echo "Need $0 " - echo "e.g. $0 rescue-source bee Branch-4.0" +if [ $# != 4 ] ; then + echo "Need $0 " + echo "e.g. $0 rescue-source bee Branch-4.0 4.0.1" exit 1 fi cd $1 @@ -39,7 +40,6 @@ if [ $? -ne 0 ]; then exit 1 fi 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 ..." -- 2.39.2