You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2015/06/24 14:58:17 UTC
[11/50] [abbrv] wicket git commit: Ask for release version,
with default from pom
Ask for release version, with default from pom
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2fe11cc1
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2fe11cc1
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2fe11cc1
Branch: refs/heads/master
Commit: 2fe11cc161506023c1ddaf04f687cb68e62c84f8
Parents: e26a10a
Author: Martijn Dashorst <da...@apache.org>
Authored: Tue Jun 16 14:27:33 2015 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Jun 24 14:56:33 2015 +0300
----------------------------------------------------------------------
release-dashorst.sh | 45 +++++++++++++++++++++++++++++++++------------
1 file changed, 33 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/2fe11cc1/release-dashorst.sh
----------------------------------------------------------------------
diff --git a/release-dashorst.sh b/release-dashorst.sh
index 1314dda..4a4efc2 100755
--- a/release-dashorst.sh
+++ b/release-dashorst.sh
@@ -38,6 +38,7 @@ function getJdkToolchain {
}
# set -e
+# set -x
# the branch on which the code base lives for this version (master is
# always current development version)
@@ -84,21 +85,41 @@ Java used to compile (from toolchain) is: $(getJdkToolchain)
agentcount=`ps aux|grep gpg-agent|wc -l`
-if [ ! -z "$1" ] ; then
- current_version="$1"
- major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*')
- minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*')
- bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-.*')
- milestone_version=$(expr $current_version : '.*\..*-M\(.*\)')
- version="$major_version.$minor_version.0-M$milestone_version"
+current_version=$(getProjectVersionFromPom)
+major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*')
+minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*')
+bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-.*')
+version="$major_version.$minor_version.0"
+
+default_version="$version"
+
+version=
+
+while [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+)?$ ]]
+do
+ read -p "Version to release (default is $default_version): " -e t1
+ if [ -n "$t1" ]
+ then
+ version="$t1"
+ else
+ version="$default_version"
+ fi
+done
+
+# recalculate the version coordinates for the current release
+major_version=$(expr $version : '\(.*\)\..*\..*')
+minor_version=$(expr $version : '.*\.\(.*\)\..*')
+bugfix_version=$(expr $version : '.*\..*\.\(.*\)')
+
+if [[ $version =~ .+-M[0-9]+ ]]
+then
+ milestone_version=$(expr $version : '.*\..*-M\(.*\)')
+fi
+
+if [ ! -z "$milestone_version" ] ; then
next_version="$major_version.0.0-SNAPSHOT"
previous_version="$major_version.0.0-SNAPSHOT"
else
- current_version=$(getProjectVersionFromPom)
- major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*')
- minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*')
- bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-.*')
- version="$major_version.$minor_version.0"
next_version="$major_version.$(expr $minor_version + 1).0-SNAPSHOT"
previous_minor_version=$(expr $minor_version - 1)
if [ $previous_minor_version -lt 0 ] ; then