diff options
-rwxr-xr-x | bin/insert-changelog | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/insert-changelog b/bin/insert-changelog index 8a96b45..33045b1 100755 --- a/bin/insert-changelog +++ b/bin/insert-changelog @@ -22,16 +22,24 @@ echo $ROLE if test $ROLE = "rpm"; then REVDATE=`date +"%a %b %d %Y"` + ZEROREV=0 + REVDESC="an integer release number" elif test $ROLE = "doc"; then REVDATE=`date +"%Y-%M-%d"` + ZEROREV=0.0 # unlikely, but you never know + REVDESC="a decimal version number" else echo "This should never happen; aborting" exit 1 fi LASTREV=$(get_latest_revision "$ROLE") +if [ -z "$LASTREV" ]; then # this is the first revision for this role + LASTREV=$ZEROREV +fi + while test -z "$NUMBER"; do - echo -n "Enter revision number greater than $LASTREV: " + echo -n "Enter $REVDESC greater than $LASTREV: " read NUMBER # Yes, it's perfectly safe to assume Python is present if test `python -c "from distutils import version; a=version.LooseVersion('$LASTREV') ; b=version.LooseVersion('$NUMBER'); print b>a"` = "False"; then |