summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-23 22:55:04 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-23 22:55:04 +0000
commit43d1e4f072d7074b52ca93ac30bc336f0c5e6b1d (patch)
tree7570158f9194e6c0c978d0037b34a7965c96d553
parent40a9d908f3446bb30502b3c75b598ed648e0828e (diff)
downloadportage-43d1e4f072d7074b52ca93ac30bc336f0c5e6b1d.tar.gz
portage-43d1e4f072d7074b52ca93ac30bc336f0c5e6b1d.tar.bz2
portage-43d1e4f072d7074b52ca93ac30bc336f0c5e6b1d.zip
Fix logic for the "selective" depgraph parameter so
that it behaves correctly in cases where installed packages provide old-style virtuals but none of the available packages do. svn path=/main/trunk/; revision=8260
-rw-r--r--pym/_emerge/__init__.py39
1 files changed, 28 insertions, 11 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index f337adfeb..e20447182 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1966,6 +1966,18 @@ class depgraph(object):
usepkgonly = "--usepkgonly" in self.myopts
empty = "empty" in self.myparams
selective = "selective" in self.myparams
+ # Behavior of the "selective" parameter depends on
+ # whether or not a package matches an argument atom.
+ # If an installed package provides an old-style
+ # virtual that is no longer provided by an available
+ # package, the installed package may match an argument
+ # atom even though none of the available packages do.
+ # Therefore, "selective" logic does not consider
+ # whether or not an installed package matches an
+ # argument atom. It only considers whether or not
+ # available packages match argument atoms, which is
+ # represented by the found_available_arg flag.
+ found_available_arg = False
for find_existing_node in True, False:
if existing_node:
break
@@ -2084,18 +2096,23 @@ class depgraph(object):
myarg = self._set_atoms.findAtomForPackage(
cpv, metadata)
except portage.exception.InvalidDependString:
- # If relevant this error will be shown
- # in the masked package display.
if not installed:
- break
- if not installed and not reinstall_for_flags and \
- ("selective" in self.myparams or \
- not myarg) and \
- not empty and \
- vardb.cpv_exists(cpv):
- break
- if installed and not (selective or not myarg):
- break
+ # masked by corruption
+ continue
+ if not installed:
+ if myarg:
+ found_available_arg = True
+ must_reinstall = empty or \
+ (myarg and not selective)
+ if not reinstall_for_flags and \
+ not must_reinstall and \
+ vardb.cpv_exists(cpv):
+ break
+ if installed:
+ must_reinstall = empty or \
+ (found_available_arg and not selective)
+ if must_reinstall:
+ break
# Metadata accessed above is cached internally by
# each db in order to optimize visibility checks.
# Now that all possible checks visibility checks