From 42dab8396651f5c82d6da40a1dc13781e8c3d53b Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 8 May 2012 16:35:08 +0000 Subject: [PATCH] ci: add automatic mechanism for determining next version number --- build/next-release.txt | 1 + scripts/ci/debsrcbuilder.sh | 6 +++++- scripts/tagscript.sh | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 build/next-release.txt diff --git a/build/next-release.txt b/build/next-release.txt new file mode 100644 index 0000000000..996f71d3b9 --- /dev/null +++ b/build/next-release.txt @@ -0,0 +1 @@ +1.2-rc3 diff --git a/scripts/ci/debsrcbuilder.sh b/scripts/ci/debsrcbuilder.sh index 8b06ab4794..e64093d120 100755 --- a/scripts/ci/debsrcbuilder.sh +++ b/scripts/ci/debsrcbuilder.sh @@ -7,7 +7,11 @@ sdir="." check_pwd check_input_ver_build $@ -eval $(parse_version "$1") +in_ver="$1" +if [ "$in_ver" = "auto" ]; then + in_ver="$(cat build/next-release.txt)" +fi +eval $(parse_version "$in_ver") datestamp="$(date +%Y%m%dT%H%M%SZ)" nightly="n${datestamp}" build="b${2-0}" diff --git a/scripts/tagscript.sh b/scripts/tagscript.sh index 30222641a6..78253a10c5 100755 --- a/scripts/tagscript.sh +++ b/scripts/tagscript.sh @@ -114,6 +114,22 @@ if (ngrep '^Saved' "$ret"); then stash_saved=1 fi +echo "Determining next-release (release+1) version..." >&2 +if [ -n "$grev" ] && ngrep '[0-9]*$' "$grev"; then + rev_ver="$(echo "$grev" | sed -e 's/^[^0-9]*\([0-9]*\)$/\1/')" + next_rev="$((rev_ver+1))" + next_ver="${gver%%$rev_ver}${next_rev}" +elif [ -n "$grev" ]; then + next_ver="${gver}1" +elif ! [ "$gmicro" = "0" ]; then + next_ver="${gver%%$micro}$((micro+1))" +else + next_ver="${gmajor}.$((gminor+1))-rc1" +fi +echo "Setting next-release version ($next_ver)..." >&2 +echo "${next_ver}" > build/next-release.txt +git add build/next-release.txt + echo "Changing the version of configure.in..." >&2 set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev"