Merged from trunk -r11811:11816
authorFabian Groffen <grobian@gentoo.org>
Sat, 15 Nov 2008 15:17:23 +0000 (15:17 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 15 Nov 2008 15:17:23 +0000 (15:17 -0000)
   | 11812   | Override Atom.__setattr__() to make Atom instances           |
   | zmedico | immutable. Thanks to Brian Harring for the suggestion.       |

   | 11813   | In Atom.__setattr__(), include inputs in case it helps for   |
   | zmedico | debugging with derived classes. Thanks to Brian Harring for  |
   |         | the suggestion.                                              |

   | 11814   | Bug #245661 - Never enable --complete-graph automatically    |
   | zmedico | since it's confusing for users.                              |

   | 11815   | Remove the special package.keywords mask warning from bug    |
   | zmedico | #223447 since --depclean now uses the depgraph class and     |
   |         | therefore should be more consistent with the update          |
   |         | algorithm.                                                   |

   | 11816   | Bug #245932 - Pass use_mask and use_force parameters into    |
   | zmedico | recursive _expand_new_virtuals() calls, fixing a TypeError   |
   |         | which is triggered inside                                    |
   |         | portage.dep._use_dep._eval_qa_conditionals().                |

svn path=/main/branches/prefix/; revision=11937

pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dep.py

index ab129754ad882e70a4b7f3ee248f7f922375273e..da187686085faacb9cb14dd54f65c3c9d3bb4cc2 100644 (file)
@@ -4194,14 +4194,7 @@ class depgraph(object):
 
        _dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
 
-       # If dep calculation time exceeds this value then automatically
-       # enable "complete" mode since any performance difference is
-       # not as likely to be noticed by the user after this much time
-       # has passed.
-       _complete_threshold = 20
-
        def __init__(self, settings, trees, myopts, myparams, spinner):
-               self._creation_time = time.time()
                self.settings = settings
                self.target_root = settings["ROOT"]
                self.myopts = myopts
@@ -5795,19 +5788,15 @@ class depgraph(object):
                intially satisfied.
 
                Since this method can consume enough time to disturb users, it is
-               currently only enabled by the --complete-graph option, or when
-               dep calculation time exceeds self._complete_threshold.
+               currently only enabled by the --complete-graph option.
                """
                if "--buildpkgonly" in self.myopts or \
                        "recurse" not in self.myparams:
                        return 1
 
                if "complete" not in self.myparams:
-                       if time.time() - self._creation_time > self._complete_threshold:
-                               self.myparams.add("complete")
-                       else:
-                               # Skip this to avoid consuming enough time to disturb users.
-                               return 1
+                       # Skip this to avoid consuming enough time to disturb users.
+                       return 1
 
                # Put the depgraph into a mode that causes it to only
                # select packages that have already been added to the
@@ -5936,43 +5925,13 @@ class depgraph(object):
                                        stale_cache.discard(cpv)
                                        pkg_in_graph = self.digraph.contains(pkg)
 
-                                       # Check for masked installed packages. For keyword
-                                       # mask there are a couple of common cases that are
-                                       # likely to generate unwanted noise:
-                                       #
-                                       #  * Packages missing /var/db/pkg/*/*/KEYWORDS entries
-                                       #    due to having been installed by an old version of
-                                       #    portage.
-                                       #
-                                       #  * Packages installed by overriding ACCEPT_KEYWORDS
-                                       #    via the environment.
-                                       #
-                                       # To avoid unwanted noise, only warn about keyword
-                                       # masks if all of the following are true:
-                                       #
-                                       #  * KEYWORDS is not empty (not installed by old portage).
-                                       #
-
+                                       # Check for masked installed packages. Only warn about
+                                       # packages that are in the graph in order to avoid warning
+                                       # about those that will be automatically uninstalled during
+                                       # the merge process or by --depclean.
                                        if pkg in final_db:
                                                if pkg_in_graph and not visible(pkgsettings, pkg):
                                                        self._masked_installed.add(pkg)
-                                               elif pkgsettings._getMissingKeywords(
-                                                       pkg.cpv, pkg.metadata) and \
-                                                       pkg.metadata["KEYWORDS"].split() and \
-                                                       not pkg_in_graph:
-                                                       try:
-                                                               ebuild = self._pkg(pkg.cpv,
-                                                                       "ebuild", pkg.root_config)
-                                                       except KeyError:
-                                                               ebuild = None
-                                                       else:
-                                                               try:
-                                                                       if not visible(pkgsettings, ebuild):
-                                                                               ebuild = None
-                                                               except portage.exception.InvalidDependString:
-                                                                       ebuild = None
-                                                       if ebuild is None:
-                                                               self._masked_installed.add(pkg)
 
                                        blocker_atoms = None
                                        blockers = None
index 7c44b20dee8ffc75a343724c32b7b6af6e6b8024..b7aa7113b24ee974f2f9f9cace241d3bce9a2d75 100644 (file)
@@ -6199,7 +6199,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                        continue
                elif isinstance(x, list):
                        newsplit.append(_expand_new_virtuals(x, edebug, mydbapi,
-                               mysettings, myroot=myroot, trees=trees, **kwargs))
+                               mysettings, myroot=myroot, trees=trees, use_mask=use_mask,
+                               use_force=use_force, **kwargs))
                        continue
 
                if not isinstance(x, portage.dep.Atom):
index fc6a8b10e66d13f9cbe2f490000ee56511f61110..c176021174a2286464ade7c5cfec680cff18df94 100644 (file)
@@ -529,29 +529,32 @@ class Atom(object):
        def __init__(self, s):
                if not isvalidatom(s, allow_blockers=True):
                        raise InvalidAtom(s)
+               obj_setattr = object.__setattr__
                for x in self._str_methods:
-                       setattr(self, x, getattr(s, x))
+                       obj_setattr(self, x, getattr(s, x))
 
                blocker = "!" == s[:1]
                if blocker:
-                       self.blocker = self._blocker(forbid_overlap=("!" == s[1:2]))
-                       if self.blocker.overlap.forbid:
+                       blocker = self._blocker(forbid_overlap=("!" == s[1:2]))
+                       if blocker.overlap.forbid:
                                s = s[2:]
                        else:
                                s = s[1:]
                else:
-                       self.blocker = False
-
-               self.cp = dep_getkey(s)
-               self.cpv = dep_getcpv(s)
-               self.slot = dep_getslot(s)
-               self.operator = get_operator(s)
-               #self.repo = self._get_repo(s)
-               self.use = dep_getusedeps(s)
-               if self.use:
-                       self.use = _use_dep(self.use)
+                       blocker = False
+               obj_setattr(self, "blocker", blocker)
+
+               obj_setattr(self, "cp", dep_getkey(s))
+               obj_setattr(self, "cpv", dep_getcpv(s))
+               obj_setattr(self, "slot", dep_getslot(s))
+               obj_setattr(self, "operator", get_operator(s))
+
+               use = dep_getusedeps(s)
+               if use:
+                       use = _use_dep(use)
                else:
-                       self.use = None
+                       use = None
+               obj_setattr(self, "use", use)
 
        def __cmp__(self, other):
                self_str = str(self)
@@ -562,6 +565,10 @@ class Atom(object):
                        return 1
                return -1
 
+       def __setattr__(self, name, value):
+               raise AttributeError("Atom instances are immutable",
+                       self.__class__, name, value)
+
 def get_operator(mydep):
        """
        Return the operator used in a depstring.