X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Frelease%2Fmakedocsrel;h=67595b9c17e2523a94f8d16de4f0214f887088f1;hb=1fbb9d5f05f5b2b3cccb9bbc51498fe670b58c55;hp=a3a0bcf85dd2e7f4f8c38f880e61217d5a51fb95;hpb=9aa1e8fd996952449ab85fcd1071f4d08f25dda8;p=bacula%2Fbacula diff --git a/bacula/release/makedocsrel b/bacula/release/makedocsrel index a3a0bcf85d..67595b9c17 100755 --- a/bacula/release/makedocsrel +++ b/bacula/release/makedocsrel @@ -9,83 +9,63 @@ # # Commit all changes, export the release, make a release tar. # +. ./functions + cwd=`pwd` reltype=release tagbase=Release- base_dir=docs base_pkg=bacula-$base_dir -branch=$3 -if [ $# != 3 ] ; then - echo "Need $0 " - echo "e.g. $0 bacula-source docs-source master" +remote=$3 +branch=$4 +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 -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 -git pull origin ${branch} +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 -git pull origin ${branch} -ver=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${bsrc}/src/version.h` +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" -git checkout master cd ${cwd} tar xfz $base_pkg-$ver.tar.gz cd $base_pkg-$ver/ @@ -93,8 +73,6 @@ mv docs $base_pkg-$ver cd $base_pkg-$ver ./configure --with-bacula=$bsrc make en -cd ${bsrc} -git checkout master cd ${cwd} echo "Tarring docs ..." tar cf $base_pkg-$ver.tar $base_pkg-$ver @@ -104,6 +82,16 @@ bzip2 $base_pkg-$ver.tar ./sign $base_pkg-$ver.tar.bz2 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}" +fi + cd ${src} -git push -git push --tags +git checkout ${current} + +cd ${bsrc} +git checkout ${bcurrent} +exit 0