[Rpm-maint] [rpm-software-management/rpm] Use git tags to determine RPM version strings (PR #4178)

Michal Domonkos notifications at github.com
Thu Apr 16 08:37:21 UTC 2026


dmnks left a comment (rpm-software-management/rpm#4178)

> Parsing the Changelog for the version info seems super fragile for what are really the "production builds" from tarballs. It'd seem safer to put the version into a special purpose file that's shipped in the tarball.

I wanted to avoid generating yet another file for the tarball, and `git log --decorate` embeds the tag info in the output (i.e. ChangeLog) so it seemed natural to reuse that. This PR also uses ChangeLog to get the commit count, but that's just for the development builds.

But I agree, it's a bit fragile indeed :sweat_smile: A separate file would be better (and wouldn't have to be fished out with `sed`).

> Having a tilde in the filename makes me a bit uneasy, BUT, we produce packages with such filenames and they're out there for years . So that's probably just me still living in a cave mentally 😄 But then, so is Github, apparently.

Yep, if anything, GH avoiding it is a hint that it might not be the best idea to use tildes like this... They aren't expanded by the shell when part of a filename, but it's a foot gun nevertheless. Not to mention that the tilde is often used to indicate backup files.

I wonder if we could use a dash instead of tilde in the tarball name, while also keeping the tilde for the version itself (in cmake config). It would probably make the maintenance of rpm.spec files a bit more cumbersome, though...

> The devel snapshot name could use some textual indicator for the status. For the uninitiated, "rpm-6.1.0~17887.tar.bz2" looks maybe too much like an official release with just a funny build number.

Indeed, I don't like it too much either. I used a number here because it sorts newer (in the `rpm-version(7)` scheme) than any pre-release (e.g. `~alpha1`). That way, assuming that the same version would be used in rpm.spec files, it would correctly upgrade whichever (pre-release) is available in the official repos.

We could use `git~` here but that would sort in between alpha/beta and rc. Same goes for `dev~`. That said, `snap~` could work too and it sorts newer than rc.

A capital letter, e.g. `Git~17887` could also work since it sorts older than any pre-releases, it would just make the use of a nightly COPR repo a bit more annoying.

But maybe we don't have to worry about the sorting here since it's just a development build after all. In that case, going with the most obvious `git~` (like we basically do currently) would be fine.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4178#issuecomment-4258558280
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4178/c4258558280 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260416/be082e95/attachment.htm>


More information about the Rpm-maint mailing list