auto-version.in: Don't scramble the version number (regression fix). master
authorMark Wooding <mdw@distorted.org.uk>
Tue, 21 May 2024 13:29:26 +0000 (14:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 21 May 2024 13:29:26 +0000 (14:29 +0100)
If both Git and Debian versions are available, then only glue the two
together if the Debian version ends with `~'.

auto-version.in
debian/changelog

index 5e0e59d..007da8b 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 ### -*-sh-*-
 ###
 #! /bin/sh
 ### -*-sh-*-
 ###
-### Make autoconf-like substitutions in files
+### Guess at the project's version number
 ###
 ### (c) 2008 Mark Wooding
 ###
 ###
 ### (c) 2008 Mark Wooding
 ###
@@ -70,6 +70,13 @@ fi
 ###--------------------------------------------------------------------------
 ### Main program.
 
 ###--------------------------------------------------------------------------
 ### Main program.
 
+## Get the Debian version, if there is one.
+if [ -f debian/changelog ]; then
+  debver=$(sed -n '/^.*(\(.*\)).*$/ { s::\1:p; q; }' debian/changelog)
+else
+  unset debver
+fi
+
 ## If this is a Git checkout then Git should be able to identify the version.
 ## If there's also a Debian version, and that ends in a `~', then prefix the
 ## Git version with this.  Note that `pkg-config' is not very good, and, in
 ## If this is a Git checkout then Git should be able to identify the version.
 ## If there's also a Debian version, and that ends in a `~', then prefix the
 ## Git version with this.  Note that `pkg-config' is not very good, and, in
@@ -78,8 +85,7 @@ fi
 ## version-comparison algorithm which specifies this behaviour, so one must
 ## be careful when choosing `~' prefixes.
 if [ -e .git ] && version=$(git describe --abbrev=4 --dirty=+ 2>/dev/null); then
 ## version-comparison algorithm which specifies this behaviour, so one must
 ## be careful when choosing `~' prefixes.
 if [ -e .git ] && version=$(git describe --abbrev=4 --dirty=+ 2>/dev/null); then
-  debver=$(sed -n '/^.*(\(.*\)).*$/ { s::\1:p; q; }' debian/changelog)
-  case $debver in *~) version=$debver$version ;; esac
+  case ${debver-nil} in *~) version=$debver$version ;; esac
   echo "$version"
   exit 0
 fi
   echo "$version"
   exit 0
 fi
@@ -92,10 +98,9 @@ if [ -f RELEASE ]; then
 fi
 
 ## If we're Debianized, then the Debian changelog ought to know.
 fi
 
 ## If we're Debianized, then the Debian changelog ought to know.
-if [ -f debian/changelog ]; then
-  sed -n '/^.*(\(.*\)).*$/ { s::\1:p; q; }' debian/changelog
-  exit 0
-fi
+case ${debver+t} in
+  t) echo "$debver"; exit 0 ;;
+esac
 
 ## Otherwise we're screwed.
 echo UNKNOWN
 
 ## Otherwise we're screwed.
 echo UNKNOWN
index 1ec7b65..9a916c3 100644 (file)
@@ -1,8 +1,15 @@
-cfd (1.3.99~) experimental; urgency=medium
-
-  * (placeholder for next minor release)
-
- -- Mark Wooding <mdw@distorted.org.uk>  Tue, 01 Oct 2019 12:53:43 +0100
+cfd (1.4.0) experimental; urgency=medium
+
+  * Have `auto-version' prefix the generated version number with the
+    Debian version, if the latter ends in a `~'.  This keeps the ordering
+    between development and release branches correct.
+  * Make `mdwsetup.py' compatible with Python 3.
+  * Introduce machinery for running Python unit tests.
+  * Turn off Python's `SIGINT' handler while building.
+  * Introduce machinery for building using multiple Python versions,
+    possibly in parallel.
+
+ -- Mark Wooding <mdw@distorted.org.uk>  Fri, 08 May 2020 03:45:20 +0100
 
 cfd (1.3.15) experimental; urgency=medium
 
 
 cfd (1.3.15) experimental; urgency=medium