release: also check against the Makefile version when branching
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 24 Apr 2013 09:03:40 +0000 (11:03 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 24 Apr 2013 09:04:35 +0000 (11:04 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
release/release.bash

index 97ee7f1..0806808 100755 (executable)
@@ -583,6 +583,20 @@ fi
 
 
 #
+# When branching, check that the version is incrementing (allow equal versions),
+# w.r.t. the version in the Makefile
+#
+if [[ "${mode}" == "${MODE_BRANCH}" ]]; then
+  declare currentMasterVersion="$(getVersionFromMakefile)"
+  checkVersionIncrementing "${currentMasterVersion}" "${relBranchVersionDigits}" 1
+  if [[ ${checkVersionIncrementingResult} -ne 0 ]]; then
+    echo "* The new version ${relBranchVersionDigits} is not greater than the current version ${currentMasterVersion}"
+    exit 1
+  fi
+fi
+
+
+#
 # Confirm the branch/release
 #
 cat >&1 << EOF