Bug 247246 - yum-priorities does not exclude obsoletes
yum-priorities does not exclude obsoletes
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
7
All Linux
low Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-06 06:47 EDT by Jason Farrell
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version: 1.1.7-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-17 23:21:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to use the replacement package architecture for obsolete checking. (824 bytes, patch)
2007-07-12 09:00 EDT, Daniel de Kok
no flags Details | Diff
Fixes obsolete handling by checking them archless. (3.04 KB, patch)
2007-07-29 04:17 EDT, Daniel de Kok
no flags Details | Diff

  None (edit)
Description Jason Farrell 2007-07-06 06:47:16 EDT
Description of problem:
the yum-priorities plugin no longer excludes obsoletes due to a change in yum's
obsoletes dictionary format.

Version-Release number of selected component (if applicable):
yum-priorities-1.1.5-1.fc7

How reproducible:
Always

Steps to Reproduce:
1. yum install yum-priorities
2. add "check_obsoletes=1" to /etc/yum/pluginconf.d/priorities.conf
3. add "priority=1" to /etc/yum.repos.d/fedora*.repo:
perl -i -pe "s/(^\s*\[.*\])/\1\npriority=1/" /tmp/yum.repos.d/{fedora*,livna*}
4. add the nasty ATRPMS 3rd party repository.  # default priority is 99
5. yum --enablerepo=atrpms update     

Actual results:
ATRPMS is still allowed to obsolete packages in the protected priority=1 repo.
At the time of this bugreport, on my system, the two packages being overridden
are "PIL" obsoleting "python-imaging", and "mpg123" replacing "mpg321".

Expected results:
obsoletes excluded.

Additional info:
The plugin author - Daniel de Kok - writes: """this bug seems to be introduced
by a change by the yum-utils maintainers. They changed the code to use the
second element in an obsolete tuple to get the architecture, while this element
clearly does not list the arch, and I don't think it ever did."""

An example obsoletes dict entry:
(u'PIL', u'i386', u'0', u'1.1.6', u'8.fc7'): [   (   u'python-imaging',
                                                          u'LT',
                                                          (   u'0',
                                                              u'1.1.6',
                                                              u'8.fc7'))],

I've tested the original version of this plugin --
http://devel.linux.duke.edu/cgi-bin/viewcvs.cgi/yum-utils/plugins/priorities/priorities.py?revision=1.1
-- and it correctly filters out the obsoletes.

Diffing yum-priorities-1.1.5-1.fc7 against the working version shows:

81,82c81
<                 key = "%s.%s" % (po.name,po.arch)
<                 if pkg_priorities.has_key(key) and pkg_priorities[key] <
repo.priority:
---
>                 if pkg_priorities.has_key(po.name) and pkg_priorities[po.name]
< repo.priority:
91,92c90
<                             key = "%s.%s" % (obsolete_pkg[0],obsolete_pkg[1])
<                             if pkg_priorities.has_key(key) and
pkg_priorities[key] < repo.priority:
---
>                             if pkg_priorities.has_key(obsolete_pkg[0]) and
pkg_priorities[obsolete_pkg[0]] < repo.priority:
102,103c100
<         key = "%s.%s" % (p.name,p.arch)
<         out[key] = priority
---
>         out[p.name] = priority
Comment 1 Daniel de Kok 2007-07-12 08:59:09 EDT
I think the sanest manner to handle this is to assume that a package obsoletes
packages with the same architecture. Since the architecture is not in the
obsoletes table (and not returned by returnObsoletes), this seems to be the only
other option (other than reverting the arch handling patch).

I have attached a patch that does this.
Comment 2 Daniel de Kok 2007-07-12 09:00:06 EDT
Created attachment 159047 [details]
Patch to use the replacement package architecture for obsolete checking.
Comment 3 Seth Vidal 2007-07-12 15:28:04 EDT
and what about noarch pkgs? Do they obsolete only other noarches, or do they
obsolete arch-pkgs too?

Comment 4 Daniel de Kok 2007-07-29 04:16:06 EDT
After some more thought: I think an package from a lower priority repo should
never be able to replace a package from a higher priority repo (as was the case
before multi-arch handling was added to yum-priorities). Patch attached.
Comment 5 Daniel de Kok 2007-07-29 04:17:16 EDT
Created attachment 160183 [details]
Fixes obsolete handling by checking them archless.
Comment 6 Jason Farrell 2007-07-31 19:30:33 EDT
Daniel - thanks - the patch did the trick. atrpms obsoletes are now being
properly excluded.
Comment 7 Fedora Update System 2007-09-10 12:51:50 EDT
yum-utils-1.1.7-1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2007-09-17 23:21:14 EDT
yum-utils-1.1.7-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.