changeset 949:ec7530f615bf

Support getting rid of version suffix.
author Sjoerd Mullender <sjoerd@acm.org>
date Mon, 13 Jan 2025 12:47:31 +0100 (2 months ago)
parents 9c310d692465
children 52508322a849
files version.sh
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/version.sh
+++ b/version.sh
@@ -85,14 +85,22 @@ for param in $* ; do
 	esac
 done
 
-echo "Current version: ${CUR_MAJOR}.${CUR_MINOR} (${CUR_SUFFIX})"
-echo "New version:     ${NEW_MAJOR}.${NEW_MINOR} (${NEW_SUFFIX})"
+if [[ -n $CUR_SUFFIX ]]; then
+    CUR_SUFFIX_p=" (${CUR_SUFFIX})"
+    ESC_SUFFIX_p=" (${ESC_SUFFIX})"
+fi
+if [[ -n $NEW_SUFFIX ]]; then
+    NEW_SUFFIX_p=" (${NEW_SUFFIX})"
+fi
+
+echo "Current version: ${CUR_MAJOR}.${CUR_MINOR}${CUR_SUFFIX_p}"
+echo "New version:     ${NEW_MAJOR}.${NEW_MINOR}${NEW_SUFFIX_p}"
 
 diff="diff -Naur"
 
 file="release.txt"
 sed \
-	-e "s|version ${ESC_MAJOR}\.${ESC_MINOR} (${ESC_SUFFIX}|version ${NEW_MAJOR}.${NEW_MINOR} \(${NEW_SUFFIX}|g" \
+	-e "s|version ${ESC_MAJOR}\.${ESC_MINOR}${ESC_SUFFIX_p}|version ${NEW_MAJOR}.${NEW_MINOR}${NEW_SUFFIX_p}|g" \
 	-e "s|${TYPE}-${ESC_MAJOR}\.${ESC_MINOR}|${TYPE}-${NEW_MAJOR}.${NEW_MINOR}|g" \
 	-e "s|Release date: 20[0-9][0-9]-[01][0-9]-[0-3][0-9]|Release date: `date +%F`|" \
 	${file} | ${diff} ${file} - | ${patch}