Bug 247246 - yum-priorities does not exclude obsoletes
Summary: yum-priorities does not exclude obsoletes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-06 10:47 UTC by Jason Farrell
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Fixed In Version: 1.1.7-1.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-18 03:21:20 UTC
Type: ---
Embargoed:


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

Description Jason Farrell 2007-07-06 10:47:16 UTC
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 12:59:09 UTC
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 13:00:06 UTC
Created attachment 159047 [details]
Patch to use the replacement package architecture for obsolete checking.

Comment 3 Seth Vidal 2007-07-12 19:28:04 UTC
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 08:16:06 UTC
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 08:17:16 UTC
Created attachment 160183 [details]
Fixes obsolete handling by checking them archless.

Comment 6 Jason Farrell 2007-07-31 23:30:33 UTC
Daniel - thanks - the patch did the trick. atrpms obsoletes are now being
properly excluded.

Comment 7 Fedora Update System 2007-09-10 16:51:50 UTC
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-18 03:21:14 UTC
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.