From: Fabian Groffen Date: Sat, 15 Nov 2008 15:17:23 +0000 (-0000) Subject: Merged from trunk -r11811:11816 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a23780d265f1d2cbff49701e34bef8ea876cbdad;p=portage.git Merged from trunk -r11811:11816 | 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 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index ab129754a..da1876860 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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 diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 7c44b20de..b7aa7113b 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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): diff --git a/pym/portage/dep.py b/pym/portage/dep.py index fc6a8b10e..c17602117 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -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.