[sane-devel] Version numbering (was Re: Fix PPA build)

Johannes Meixner jsmeix at suse.de
Mon May 15 08:29:49 UTC 2017


On May 12 19:18 allan noahwrote (excerpt):

> They are already 1.0.26+gitxxxx,

Simply put:
A version number like 1.0.26+gitxxxx should have never
been used for somethig after 1.0.25 but before 1.0.26
because 1.0.26+gitxxxx means that it is after 1.0.26.
I.e. 1.0.26+gitxxxx is wrong, cf. my explanation below
about Ghostscript release candidates where the
Ghostscript upstream release candidate version number
is also just wrong like 9.15rc1 for the first release
candidate of the upcoming Ghostscript 9.15 release.

On May 13 12:10 Olaf Meeuwissen wrote (excerpt):
> Distributions can also work around with an "epoch",
> so you get something like "1:1.0.26+gitxxxx",
> but that's a bit ugly.

at least not at openSUSE because here RPM "epoch" stuff
is "forbidden by policy".
I don't know the exact reasons behind but at last one reason
is - as far as I know - that once you have set an "epoch"
yon could never ever get rid of it later.
I.e. basically introducing "epoch" is like introducing
a leading "absolute maximum" part of the version i.e. a switch
from "major.minor.patchlevel" to "epoch.major.minor.patchlevel".

> But we could also just admit that we've more or less
> goofed up on the versioning for our master branch,
> skip 1.0.26 and release as 1.0.27.
> Doing so will bypass any of the scenarios you worry about.

Yes, please skip 1.0.26 and release as 1.0.27.
This is simple, fail safe, and avoids needless complications.

Im general regarding how to keep strictly growing
version numbers, here some exceprts from the openSUSE
ghostscript.spec file that explain how correct version numbers
for intermediate stuff after version 1.2.3. like Git snapshots
or release candidates for a next version 1.3.0 should look like:
# Special version needed for Ghostscript release candidates
# (e.g. "Version: 9.14pre15rc1" for 9.15rc1).
# Version 9.15rc1 would be newer than 9.15
# (run "zypper vcmp 9.15rc1 9.15") 
# because the rpmvercmp algorithm
# would treat 9.15rc1 as 9.15.rc.1
# (alphabetic and numeric sections get separated
#  into different elements)
# and 9.15.rc.1 is newer than 9.15
# (it has one more element in the list while 
#  previous elements are equal)
# so that we use an alphabetic prefix 'pre'
# to make it older than 9.15
# (numbers are considered newer than letters).
# But only with the alphabetic prefix "9.pre15rc1"
# would be older than the previous version number "9.14"
# because rpmvercmp would treat 9.pre15rc1 as 9.pre.15.rc1
# and letters are older than numbers
# so that we keep additionally the previous version number
# to upgrade from the previous version:
Version:        9.14pre15rc1
This way users can "just upgrade" from Ghostscript release 9.14
to intermediate Ghostscript release candidates like 9.14pre15rc1
and further to 9.14pre15rc2 and 9.14pre15rc3 as they like and
finally to the next Ghostscript release 9.15.

Kind Regards
Johannes Meixner
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Graham Norton - HRB 21284 (AG Nuernberg)

More information about the sane-devel mailing list