calc_depclean: use depgraph._pkg()
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Nov 2010 20:10:35 +0000 (13:10 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 24 Nov 2010 01:40:44 +0000 (17:40 -0800)
pym/_emerge/actions.py

index 88f0a61d8bd767f87b4d6a72cdbb3db51f9c51d2..1d334bde7d969a6a7a1f92ce9e362feba0a2e5c0 100644 (file)
@@ -1009,11 +1009,11 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 
                                                if len(provider_dblinks) > 1:
                                                        for provider_dblink in provider_dblinks:
-                                                               pkg_key = ("installed", myroot,
-                                                                       provider_dblink.mycpv, "nomerge",
-                                                                       "installed")
-                                                               if pkg_key not in clean_set:
-                                                                       provider_pkgs.add(vardb.get(pkg_key))
+                                                               provider_pkg = resolver._pkg(
+                                                                       provider_dblink.mycpv, "installed",
+                                                                       root_config, installed=True)
+                                                               if provider_pkg not in clean_set:
+                                                                       provider_pkgs.add(provider_pkg)
 
                                                if provider_pkgs:
                                                        continue
@@ -1022,8 +1022,8 @@ def calc_depclean(settings, trees, ldpath_mtimes,
                                                        lib_consumers.update(owner_set)
 
                                        for consumer_dblink in list(lib_consumers):
-                                               if ("installed", myroot, consumer_dblink.mycpv,
-                                                       "nomerge", "installed") in clean_set:
+                                               if resolver._pkg(consumer_dblink.mycpv, "installed",
+                                                       root_config, installed=True) in clean_set:
                                                        lib_consumers.remove(consumer_dblink)
                                                        continue
 
@@ -1074,8 +1074,8 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 
                        for pkg, consumers in consumer_map.items():
                                for consumer_dblink in set(chain(*consumers.values())):
-                                       consumer_pkg = vardb.get(("installed", myroot,
-                                               consumer_dblink.mycpv, "nomerge", "installed"))
+                                       consumer_pkg = resolver._pkg(consumer_dblink.mycpv,
+                                               "installed", root_config, installed=True)
                                        if not resolver._add_pkg(pkg,
                                                Dependency(parent=consumer_pkg,
                                                priority=UnmergeDepPriority(runtime=True),