Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 160183 Details for
Bug 247246
yum-priorities does not exclude obsoletes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fixes obsolete handling by checking them archless.
priorities-fix-obsolete-handling.diff (text/plain), 3.04 KB, created by
Daniel de Kok
on 2007-07-29 08:17:16 UTC
(
hide
)
Description:
Fixes obsolete handling by checking them archless.
Filename:
MIME Type:
Creator:
Daniel de Kok
Created:
2007-07-29 08:17:16 UTC
Size:
3.04 KB
patch
obsolete
>--- priorities.py.orig 2007-07-18 11:24:19.000000000 +0200 >+++ priorities.py 2007-07-29 10:13:47.000000000 +0200 >@@ -1,6 +1,6 @@ > #!/usr/bin/env python > # >-# yum-plugin-priorities 0.0.4 >+# yum-plugin-priorities 0.0.5 > # > # Copyright (c) 2006 Daniel de Kok > # >@@ -67,13 +67,21 @@ > if check_obsoletes: > obsoletes = conduit._base.pkgSack.returnObsoletes() > >- # Build a dictionary with package priorities >- pkg_priorities = {} >+ # Build a dictionary with package priorities. Since we handle obsoletes >+ # archless, also build an archless package priority dictionary for >+ # obsolete handling. >+ pkg_priorities = dict() >+ if check_obsoletes: >+ pkg_priorities_archless = dict() > for repo in allrepos: > if repo.enabled: >- repopkgs = _pkglisttodict(conduit.getPackages(repo), repo.priority) >+ repopkgs = _pkglist_to_dict(conduit.getPackages(repo), repo.priority) > _mergeprioritydicts(pkg_priorities, repopkgs) > >+ if check_obsoletes: >+ repopkgs_archless = _pkglist_to_archless_dict(conduit.getPackages(repo), repo.priority) >+ _mergeprioritydicts(pkg_priorities_archless, repopkgs_archless) >+ > # Eliminate packages that have a low priority > for repo in allrepos: > if repo.enabled: >@@ -83,26 +91,35 @@ > conduit.delPackage(po) > cnt += 1 > conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid)) >- >+ >+ # If this packages obsoletes other packages, check whether >+ # one of the obsoleted packages is not available through >+ # a repo with a higher priority. If so, remove this package. > if check_obsoletes: > if obsoletes.has_key(po.pkgtup): > obsolete_pkgs = obsoletes[po.pkgtup] > for obsolete_pkg in obsolete_pkgs: >- key = "%s.%s" % (obsolete_pkg[0],obsolete_pkg[1]) >- if pkg_priorities.has_key(key) and pkg_priorities[key] < repo.priority: >+ pkg_name = obsolete_pkg[0] >+ if pkg_priorities_archless.has_key(pkg_name) and pkg_priorities_archless[pkg_name] < repo.priority: > conduit.delPackage(po) > cnt += 1 > conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid)) > break > conduit.info(2, '%d packages excluded due to repository priority protections' % cnt) > >-def _pkglisttodict(pl, priority): >- out = {} >+def _pkglist_to_dict(pl, priority): >+ out = dict() > for p in pl: > key = "%s.%s" % (p.name,p.arch) > out[key] = priority > return out > >+def _pkglist_to_archless_dict(pl, priority): >+ out = dict() >+ for p in pl: >+ out[p.name] = priority >+ return out >+ > def _mergeprioritydicts(dict1, dict2): > for package in dict2.keys(): > if not dict1.has_key(package) or dict2[package] < dict1[package]:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247246
:
159047
| 160183