Return all the replacing packages as an array

This commit is contained in:
Faik Uygur
2009-12-02 12:42:55 +00:00
parent 710bfd1b2e
commit 8640c4ac00
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ def list_replaces(repo=None):
@param repo: Repository of the replaced packages. If repo is None than returns
a dictionary of all the replaced packages in all the repositories
{'gaim':'pidgin, 'actioncube':'assaultcube'}
{'gaim':['pidgin'], 'gimp-i18n':['gimp-i18n-tr', 'gimp-18n-de', ...]}
gaim replaced by pidgin and actioncube replaced by assaultcube
"""
+1 -1
View File
@@ -203,7 +203,7 @@ class PackageDB(lazydb.LazyDB):
replaces = self.get_package(pkg_name).replaces
for r in replaces:
if pisi.replace.installed_package_replaced(r):
pairs[r.package] = pkg_name
pairs.setdefault(r.package, []).append(pkg_name)
return pairs
+3 -1
View File
@@ -114,7 +114,9 @@ def upgrade(A=[], repo=None):
# Force upgrading of installed but replaced packages or else they will be removed (they are obsoleted also).
# This is not wanted for a replaced driver package (eg. nvidia-X).
A |= set(replaces.values())
#
# sum(array, []) is a nice trick to flatten an array of arrays
A |= set(sum(replaces.values(), []))
A |= upgrade_base(A)