Return all the replacing packages as an array
This commit is contained in:
+1
-1
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user