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 Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:26 GMT
Task Type General Gripe
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
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

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:26 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/zeitgeist/issues/1
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 https://bbs.archlinux.org/viewtopic.php?id=241987

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.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.