tools/make-dist: tweak "git" version number scheme

Our existing scheme produces versions like

  290.47.gd85c03a6e.dirty

which is fine with automake and RPM.  Python PEP 440 doesn't like it,
though, on account of the 'g' following a '.' where a digit is expected.

PEP 440 specifies a syntax for "developmental releases" ('.devN') as
well as "local version identifiers" ('+').  Let's introduce a new way
of formatting our version numbers for CI builds inspired by the way that
setuptools-scm does it.  Our snapshot versions now look like:

  290.dev47+gd85c03a6e.dirty
This commit is contained in:
Allison Karlitskaya 2023-04-27 16:20:26 +02:00 committed by Martin Pitt
parent ea450fdd43
commit 6802634b8c
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ cd "$(realpath -m "$0"/../..)"
message() { printf " %-8s %s\n" "$1" "$2" >&2; }
# Set the version number from the state at the time the build was requested
VERSION="$(git describe --tags --long --dirty | tr '-' '.')"
VERSION="$(git describe --tags --long --dirty=.dirty | sed 's/-\([0-9]*\)-g/.dev\1+g/')"
while [ $# != 0 ] ; do
case "$1" in