Bug 82639
| Summary: | Bad values returned from rpmvercmp from rpmlib | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Alexander Kanevskiy <kad> | ||||
| Component: | rpm | Assignee: | Jeff Johnson <jbj> | ||||
| Status: | CLOSED DUPLICATE | QA Contact: | Mike McLean <mikem> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 8.0 | ||||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2003-01-24 15:54:56 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Alexander Kanevskiy
2003-01-24 10:44:08 UTC
rpmvercmp does what it does, has always done what it has done, cannot and will not change. Yes there are odd corner cases comparing alpha with digit strings. See #50973 (from memory) for gory details. I fix this function to work more gracefully in case Release consist versions and numbers. Here is test. return: - is patched result, rh: is original result. Fix me if I wrong. Patch will be attached. return 1: a is newer than b 0: a and b are the same version -1: b is newer than a a: 1.asp b: 1.7x.2asp return: -1 rh: -1 a: 1.7x.2asp b: 1.asp return: 1 rh: -1 a: asp1 b: asp1.7x.2 return: -1 rh: -1 a: asp1.7x.2 b: asp1 return: 1 rh: 1 a: 1 b: asp1.7x.2 return: 1 rh: -1 a: asp1.7x.2 b: 1 return: -1 rh: -1 a: asp1 b: 1.7x.2 return: -1 rh: -1 a: 1.7x.2 b: asp1 return: 1 rh: -1 a: 1 b: 1.7x.2 return: -1 rh: -1 a: 1.7x.2 b: 1 return: 1 rh: 1 a: 1.asp b: 1.asp return: 0 rh: 0 a: 1.asp b: 0.7.3 return: 1 rh: 1 a: 3asp b: 3.asp return: 0 rh: 0 a: 9.0 b: 10.0 return: -1 rh: -1 a: 9asp b: 10 return: -1 rh: -1 a: 9 b: 15.asp return: -1 rh: -1 a: owl1 b: 1asp return: -1 rh: -1 a: alt1 b: 1asp return: -1 rh: -1 a: alt2 b: 1 return: -1 rh: -1 a: 0.7.2.asp b: 0.7.3asp return: -1 rh: -1 a: 0.7.2.asp b: 0.7.2asp return: 0 rh: 0 a: asp1 b: alt1 return: 1 rh: 1 a: ipl4mdk b: alt0.8 return: 1 rh: 1 a: alt0.8 b: ipl4mdk return: -1 rh: -1 Created attachment 89573 [details]
quick fix.
We can assume what we a comparing numbers only if str1 and str2 is numbers. not
only str1
Again, there is no such thing as a "quick fix" for rpmvercmp. See details at #50977. *** This bug has been marked as a duplicate of 50977 *** |