auto-version.in: Factor out Debian version checking. master
authorMark Wooding <mdw@distorted.org.uk>
Fri, 3 May 2024 21:51:43 +0000 (22:51 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 3 May 2024 21:51:43 +0000 (22:51 +0100)
Also fixes a bug: we assumed that `debian/changelog' existed if we had a
Git version to check.

auto-version.in
debian/changelog

index 5e0e59d..59c75c0 100755 (executable)
@@ -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+t} in t) 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