Bug 179060

Summary: rpm-python rpm.labelCompare() chooses different packages than rpm command
Product: [Fedora] Fedora Reporter: Laurie Reeves <laurie>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-26 22:17:02 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:

Description Laurie Reeves 2006-01-26 21:44:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051121 Fedora/1.0.7-1.1.fc4.userful.1 Firefox/1.0.7

Description of problem:
Here's the output from the rpm command (rpm -Uvh lame-*). 

warning: package lame = 0:3.96.1-0.lvn.1.4 was already added, replacing with lame <= 3.96.1-0.lvn.4.4
warning: package lame-devel = 0:3.96.1-0.lvn.1.4 was already added, replacing with lame-devel <= 3.96.1-0.lvn.4.4

My script produces this output:

Discarding lame (3.96.1-0.lvn.4.4 < 0:3.96.1-0.lvn.1.4)
Discarding lame-devel (3.96.1-0.lvn.4.4 < 0:3.96.1-0.lvn.1.4)


Version-Release number of selected component (if applicable):
rpm-4.3.2-21 rpm-python-4.3.2-21

How reproducible:
Always

Steps to Reproduce:
1. Upgrade multiple packages with the same name but different EVR
2. Note which packages are chosen
3. Use python's rpm.labelCompare() to compare packages
4. Again, note which packages are chosen

  

Actual Results:  different packages will be chosen depending on the quarky way the packager packaged the package

Expected Results:  the rpm command and the rpm-python rpm.labelCompare() function should give the same results.

Additional info:

I think the rpm command's behaviour is wrong in this case because the one without the epoch is chosen. The packager incorrectly dropped the epoch and didn't notice the error because the rpm command agreed with him.

I guess the rpm command is using the release part of the EVR. In this case it (incorrectly) gets the newest one.

Comment 1 Jeff Johnson 2006-01-26 22:17:02 UTC
The easiest fix is to specify what packages you want installed, not relying on whatever
heuristic is in rpmlib to discard older packages that are included with a "*".

Fixed upstream.

Comment 2 Laurie Reeves 2006-01-26 23:03:00 UTC
I'm trying to use a python script to determine which package to use. The only
think I have it to rely on rpmlib's heuristic. The problem is, rpm and
rpm-python are doing it differently.

Is this upsteam fix going to make it into FC4 updates?