[rpm] Fix rpm package comparation with not defined release part
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
packetary |
Fix Released
|
Critical
|
Sergey Kulanov |
Bug Description
RPM package version consists of three parts: E - epoch, V - version, R - release, so
if E1=E2 and V1=V2 we've comparing on release part, please check [1]:
1) Set each epoch value to 0 if it’s null/None.
2) Compare the epoch values using compare_values(). If they’re not equal, return that result, else move on to the next portion (version). The logic within compare_values() is that if one is empty/null and the other is not, the non-empty one is greater, and that ends the comparison. If neither of them is empty/not present, compare them using rpmvercmp() and follow the same logic; if one is “greater” (newer) than the other, that’s the end result of the comparison. Otherwise, move on to the next component (version).
3) Compare the versions using the same logic.
4) Compare the releases using the same logic.
5) If all of the components are “equal”, the packages are the same.
so we need to fix packetary to correctly process cases with empty release field:
[root@88a81c755aa2 /]# rpmdev-vercmp 8.0.0-0~rc1 8.0.0
8.0.0-0~rc1 > 8.0.0
[root@88a81c755aa2 /]# rpmdev-vercmp 13.9-16.12 13.9
13.9-16.12 > 13.9
Fix proposed to branch: master /review. openstack. org/322791
Review: https:/