Bug 811992
Summary: | Comparison of NVRs with release containing some non-numeric characters works surprisingly | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Honza Horak <hhorak> |
Component: | rpm | Assignee: | Packaging Maintenance Team <packaging-team-maint> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 23 | CC: | a.badger, ffesti, ovasik, pknirsch, pmatilai, ville.skytta |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-03-11 13:34:36 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Honza Horak
2012-04-12 13:26:01 UTC
First, strictly speaking your examples are not valid -- rpmdev-vercmp takes (Epoch:)Version-Release strings as arguments, you're feeding it Name-Version-Release-Arch strings. It doesn't seem to affect the outcome of the test cases though. $ rpmdev-vercmp 1-1.fc17 1-1b.fc17 1-1.fc17 > 1-1b.fc17 $ rpmdev-vercmp 1-1.fc17 1-1p.fc17 1-1.fc17 < 1-1p.fc17 Anyway, this comes directly from rpm-python, reassigning to rpm: $ python >>> import rpm >>> rpm.labelCompare((None, "1", "1.fc17"), (None, "1", "1b.fc17")) 1 >>> rpm.labelCompare((None, "1", "1.fc17"), (None, "1", "1p.fc17")) -1 Just a hunch, if it's a-f characters that are behaving differently than others, maybe they're being interpreted as hex digits somewhere? Heh, interesting corner-case. It's not interpreting as hex though, what's mixing things up is the dist tag. Here's what happens (some debug output added): [pmatilai@localhost rpm]$ ./rpm --eval '%{lua:print(rpm.vercmp("1.fc17","1a.fc17"))}' rpmvercmp: 1 - 1, isnum 1 rpmvercmp: fc - a, isnum 0 1 [pmatilai@localhost rpm]$ ./rpm --eval '%{lua:print(rpm.vercmp("1.fc17","1g.fc17"))}' rpmvercmp: 1 - 1, isnum 1 rpmvercmp: fc - g, isnum 0 -1 rpmvercmp() works by looping through the version strings, seeking for all-numeric or all-alphabetic "segments" and comparing those. Any alphabet <-> digit character class change in a version string is a segment break. While a dot also is a segment break, it doesn't have any special "grouping" effect in the sense that one might expect here. I guess I'll take this up on rpm-maint to see what others think, it does look "obviously wrong" but changing rpmvercmp() is fairly risky business, this behavior is more than a decade old AFAICS. Yep, version compare is quite tricky, it's hard to get expected results for all cases, I remember all the issues when we were doing that for 'sort' and 'ls' utility version compare. At least 3 or 4 implementation (Debian has it's own, rpm it's own, gnulib has two (strverscmp(), filevercmp() ) - strverscmp() is close to the rpm one, filevercmp() is hopefully identical to the Debian one (and different from the output expected by reported btw.) ) This message is a reminder that Fedora 16 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '16'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 16's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 16 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged to click on "Clone This Bug" and open it against that version of Fedora. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping rpm-4.11.0-0.beta1.1.fc19.x86_64 has the same results for tests in comment 2. This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. rpm-4.12.0.1-8.fc23.x86_64 still behaves as in comment 2. This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle. Changing version to '23'. (As we did not run this process for some time, it could affect also pre-Fedora 23 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23 OK, while this is confusing, we just can't change the way version compare is done. The way to solve this would be to introduce a new rpm tag as a new home of the dist tag. But this is another story for another time. |