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
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.
Created attachment 159047 [details] Patch to use the replacement package architecture for obsolete checking.
and what about noarch pkgs? Do they obsolete only other noarches, or do they obsolete arch-pkgs too?
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.
Created attachment 160183 [details] Fixes obsolete handling by checking them archless.
Daniel - thanks - the patch did the trick. atrpms obsoletes are now being properly excluded.
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.
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.