configure.ac: Complicate ASDF version-number generation.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 7 Oct 2019 00:33:10 +0000 (01:33 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 7 Oct 2019 00:35:01 +0000 (01:35 +0100)
I've started prefixing a future-version-~ to development version
numbers, rather than maintenance pre-releases.  Adjust the ASDF version
synthesis to cope with this.

configure.ac

index 5e121cd..765924a 100644 (file)
@@ -42,21 +42,25 @@ dnl--------------------------------------------------------------------------
 dnl Convert the version number for ASDF.
 
 ## This is surprisingly awful.  The convention for official version numbers
-## is that they look like MAJOR.MINOR.PATCH[.BPB][-N-gHEX[+]].  ASDF
-## insists on simple numeric things separated by dots.  If there's no Git
-## thing on the end, then the main version number will do fine.  If there
-## is, then we insert /two/ `0's in, followed by N and the HEX converted to
-## decimal.  Why two?  Because if there's no brown-paper-bag number, we
-## want to make sure that the first BPB release is higher than any of the
-## preceding Git revisions.
+## is that they look like [MAJOR.MINOR.PATCH~]MAJOR.MINOR.PATCH[.BPB]
+## [-N-gHEX[+]].  ASDF insists on simple numeric things separated by dots.
+## If there's no interim-version thing on the front or Git thing on the end,
+## then the main version number will do fine.  If there is, then we insert
+## /two/ `0's in, followed by N and the HEX converted to decimal.  Why two?
+## Because if there's no brown-paper-bag number, we want to make sure that
+## the first BPB release is higher than any of the preceding Git revisions.
 ver=AC_PACKAGE_VERSION
 case $ver in
   *-*-g*)
-    base=${ver%%-*} tail=${ver#*-}
+    case $ver in
+      *~*) pre=${ver%%~*}. tail=${ver#*~} ;;
+      *) pre= tail=$ver ;;
+    esac
+    base=${tail%%-*} tail=${tail#*-}
     n=${tail%%-*} tail=${tail#*-g}
-    case $tail in *+) grubby=.1 tail=${tail%+} ;; *) grubby= ;; esac
+    case $tail in *+) grubby=.0.1 tail=${tail%+} ;; *) grubby= ;; esac
     rev=$(( 0x$tail ))
-    ASDF_VERSION=$base.0.0.$n.$rev$grubby
+    ASDF_VERSION=$pre$base.0.0.$n.$rev$grubby
     ;;
   *)
     ASDF_VERSION=$ver