Make dep_zapdeps() fall back to installed packages in it's
authorZac Medico <zmedico@gentoo.org>
Thu, 20 Dec 2007 13:06:15 +0000 (13:06 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 20 Dec 2007 13:06:15 +0000 (13:06 -0000)
availability test in cases where the package does not
appear to be masked. This solves dep selection preference
issues when working without a portage tree.

svn path=/main/trunk/; revision=8988

pym/portage/__init__.py

index b174a12acdab487ff7628c632c17245c1a16f912..8f75a319a180a2eb601e7e588172789c51332019 100644 (file)
@@ -5230,7 +5230,8 @@ 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:
+                       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.