Slightly improved the masked package check inside dep_zapdeps().
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 00:48:56 +0000 (00:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 00:48:56 +0000 (00:48 -0000)
(trunk r9006)

svn path=/main/branches/2.1.2/; revision=9007

pym/portage.py

index d58a7e9292c8020a83b3f0b96a3155d38322443e..7be824bc85e715991d09e705da4f5eff87003a80 100644 (file)
@@ -5210,15 +5210,15 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                        if avail_pkg:
                                avail_slot = "%s:%s" % (dep_getkey(atom),
                                        mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
-                       elif not avail_pkg and \
-                               (use_binaries or not mydbapi.cp_list(dep_getkey(atom))):
-                               # With --usepkgonly, count installed packages as "available".
-                               # Note that --usepkgonly currently has no package.mask support.
-                               # See bug #149816.
-                               avail_pkg = best(vardb.match(atom))
-                               if avail_pkg:
-                                       avail_slot = "%s:%s" % (dep_getkey(atom),
-                                               vardb.aux_get(avail_pkg, ["SLOT"])[0])
+                       elif not avail_pkg:
+                               has_mask = False
+                               if hasattr(mydbapi, "xmatch"):
+                                       has_mask = bool(mydbapi.xmatch("bestmatch-all", atom))
+                               if (use_binaries or not has_mask):
+                                       avail_pkg = best(vardb.match(atom))
+                                       if avail_pkg:
+                                               avail_slot = "%s:%s" % (dep_getkey(atom),
+                                                       vardb.aux_get(avail_pkg, ["SLOT"])[0])
                        if not avail_pkg:
                                all_available = False
                                break