gnome ecosystem: Git package versioning is poorly thought out and breaks vercmp
Task Info (Flyspray) | |
---|---|
Opened By | Mantas Mikulėnas (grawity) |
Task ID | 60830 |
Type | General Gripe |
Project | Arch Linux |
Category | Packages: Extra |
Version | None |
OS | All |
Opened | 2018-11-16 19:59:42 UTC |
Status | Unassigned |
Details
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).