exit 1
}
+branch_check () {
+ if ! git branch | egrep -q '^\* master$'; then
+ ( echo ">>> Warning: you are not running on the master branch <<<"
+ git branch; echo ) 1>&2
+ fi
+}
+
######################################################################
+branch_check
+
case $1 in
[0-9]* ) version=$1 ;;
* ) usage ;;
esac
-echo "See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure"
-echo ""
-echo "Did you updated the news log file?"
+
+cat <<EOF
+#!/bin/sh
+#
+# See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure
+#
+
+set -e
+
+EOF
+
+echo "# Did you updated the news log file?"
for file in Changes News NEWS
do
if [ -e $file ]; then
- ls -l $file
+ echo "# $(ls -l $file)"
fi
done
echo ""
perl=false
fi
-if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then
+if [ `ls | egrep '\.spec$' | wc -l` -eq 0 ]; then
usage "No *.spec file found"
else
spec=`ls |egrep '\.spec$' | head -1`
perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
if $java; then
- echo "set maven version to $version"
+ echo "# set maven version to $version"
mvn versions:set -DnewVersion=$version > mvn-versions.log
fi
if $perl; then
- echo "check perl version numbers"
- find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' | egrep -v '^\./deb-src/'
+ echo "# check perl version numbers"
+ find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' |
+ egrep -v '^\./deb-src/' | perl -npe 's,^,# ,'
fi
# update debian version file
echo "git push origin master"
echo "git push origin tag v$version"
+# EOF
+