Opened 6 years ago
Last modified 3 years ago
Reported by: ensc Assigned to: pmatilai Priority: major Milestone: rpm-4.10.0 Component: rpm Version: RPM Development Keywords: Cc: stick, stressy
It would be nice when a special handling of '~' would be introduced to mark "negative" version tokens. E.g. so that
| foo-1.0~beta < foo-1.0
holds. This would simplify complicated rulesets which deal with such naming schemes by abusing %release for it.
Also pullable via
git://dev.medozas.de/rpm master
The patch 0001.diff was actually for 4.4.2, because someone had the bright idea of making the master branch 4.4.2 instead of 4.7. Adding new ones.
4.7 rpm tilde patch for vercmp
4.7 patch for rpmbuild
patch for rpm-4.8
patch for rpmbuild-4.8
git location rebased.
I finally (duh) got around to take a closer look at this, starting with a test-suite for the vercmp() behavior to make it easier to test and spot regressions.
For the simple case of eg 6.0 vs 6.0~rc1 it seems to work as intended, eg
16: rpmvercmp(6.0~rc1, 6.0) = -1 ok
17: rpmvercmp(6.0~rc1, 6.0~rc1) = 0 ok
but it doesn't handle multiple tildes correctly, these can't both be right:
18: rpmvercmp(6.0~rc1~git123, 6.0~rc1) = -1 ok
19: rpmvercmp(6.0~rc1, 6.0~rc1~git123) = -1 ok
Since mirroring dpkg behavior seems the sensible thing to do here, 6.0~rc1 should be considered newer than 6.0~rc1~git123 afaict.
Another thing that needs considering is handling compatibility, this introduces a rather big change in rpm behavior. While recent rpm versions reject tilde in version and release at build-time, there's a huge installed base where that's not the case, and packages built with those versions can have tilde in version/release and expecting a completely different behavior.
It would be possible to add an rpmlib() dependency tracking for new packages using the tilde syntax, that would prevent old rpm versions from installing packages depending on the new semantics. However that still leaves the problem of new rpm installing older packages which can have tilde in version/release without meaning the new semantics. Fully handling it would require rpmvercmp() taking a flag which semantics to use... which starts getting rather ugly.
It would be possible to add an rpmlib() dependency tracking for new packages using the tilde syntax, that would prevent old rpm versions from installing packages depending on the new semantics
This kind of solves the problem for rpm, although it seems pretty heavy handed for just a change to the version comparison. But for anything above rpm it doesn't help at all ... yum can't see those rpmlib when it sees a version in primary or updateinfo or etc.
However that still leaves the problem of new rpm installing older packages which can have tilde in version/release without meaning the new semantics. Fully handling it would require rpmvercmp() taking a flag which semantics to use
Well, in theory you'd need two flags (one for each side of the test). But if you did that then _everything_ that produced or consumed an rpmversion would have to also produce/consume a flag. IMNSHO this isn't going to happen.
If you are worried that there are significant rpms out there with ~ in them, a much better fix is to just do the proposed ~ change but wait a few years with the current "~ is invalid" code in rpmbuild still on. Or just don't change it :). No rpmlib and no flags, please.
rpmbuild --allow-tilde :-) And later remove it again.
This is now included, finally :) https://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=db28221a4a48f6ee3c804c92314330637c808638