Red Hat Bugzilla – Bug 179060
rpm-python rpm.labelCompare() chooses different packages than rpm command
Last modified: 2007-11-30 17:11:22 EST
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):
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.
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.
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 "*".
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?