Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#60830 - [zeitgeist] gnome ecosystem: Git package versioning is poorly thought out and breaks vercmp

Attached to Project: Arch Linux
Opened by Mantas Mikul─Śnas (grawity) - Friday, 16 November 2018, 19:59 GMT
Last edited by Eli Schwartz (eschwartz) - Tuesday, 18 December 2018, 16:23 GMT
Task Type General Gripe
Category Packages: Extra
Status Assigned
Assigned To Jan de Groot (JGC)
Jan Alexander Steffens (heftig)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 4
Private No


The problem with just doing the simple s/-/+/g is that vercmp treats + identically to . and therefore the resulting version number is 'newer' than actual point releases:

"warning: zeitgeist: local (1.0+1+g1bcc8585-2) is newer than extra (1.0.1-1)"

Adding some letters would avoid this problem (unless you like bumping epoch every time this happens). My favourite is:

pkgver() { cd $pkgname; git describe --tags | sed 's/-/.r/; s/-/./g'; }

This would result in 1.0.r1.g1bcc8585-2, which correctly compares as 'older' than 1.0.1-1 (and I like the dots, but it works equally well with +'s).
This task depends upon

Comment by Eli Schwartz (eschwartz) - Friday, 16 November 2018, 20:04 GMT
$ vercmp 1.0+1+g1bcc8585-2 1.0.1.g1bcc8585-2

Also see

The entire gnome stack really needs this change.

The AUR has had guidelines which describe using the "r", and recommend using a dot over a plus, since makepkg originally got native support for -git packages.

It's been fairly well tested, since -git packages actually hit this sort of issue all the time.