Bug 1129865

Summary: rpmdev_vercmp vs. yum: underscore in version
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: rpmdevtoolsAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: a.badger, bugs.michael, kmcmartin, twoerner, ville.skytta
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: 2014-08-14 08:36:55 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 Jerry James 2014-08-13 19:49:42 UTC
Description of problem:
As seen in the 20140813 Rawhide update:

$ rpm -q iwl5000-firmware
iwl5000-firmware-8.83.5.1_1-38.fc21.1.noarch
$ rpmdev-vercmp iwl5000-firmware-8.83.5.1_1-38.fc21.1 iwl5000-firmware-8.83.5.1-39.fc22.1
iwl5000-firmware-8.83.5.1_1-38.fc21.1 < iwl5000-firmware-8.83.5.1-39.fc22.1

So that's an upgrade, right?  But yum distro-sync disagrees:
...
Downgrading:
 iwl5000-firmware                                 noarch        8.83.5.1-39.fc22.1                        rawhide         293 k
...

Version-Release number of selected component (if applicable):
rpmdevtools-8.4-3.fc21.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run the query shown above
2. Observe that rpmdev-vercmp considers it an upgrade
3. Observe that yum considers it a downgrade

Actual results:
yum and rpmdev-vercmp disagree.

Expected results:
yum and rpmdev-vercmp agree.

Additional info:

Comment 1 Ville Skyttä 2014-08-14 08:36:55 UTC
I don't think there's anything to do about this. When rpmdev-vercmp is splitting the string "iwl5000-firmware-8.83.5.1_1-38.fc21.1" to name, version and release they become:

Name: iwl5000
Version: firmware
Release: 8.83.5.1_1-38.fc21.1

...which is correct but obviously (to a human) not what was intended and probably explains the rest of the results. yum has more precise info to work with, it doesn't have to parse the single string above into name, version and release but gets them separetely pre-parsed. rpmdev-vercmp has a mode where you can input name/version/release separately as well, I suppose that'd make it work like yum as that way it has the same info available.