From dcf5a088ddfa777fdd279213cb90252515e46a35 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 8 Feb 2008 08:39:58 +0000 Subject: Bug #208708 - Fix masked package display some more: - Warn if all matching ebuilds are masked or the installed package itself is masked. - Do not warn if there are simply no matching ebuilds since that would be annoying in some cases. svn path=/main/trunk/; revision=9293 --- pym/_emerge/__init__.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 12922636a..5be88735d 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -2082,15 +2082,41 @@ class depgraph(object): continue pkg, existing_node = self._select_package( myroot, atom, onlydeps=onlydeps) - if not pkg or \ - (pkg.installed and portdb.xmatch("match-all", atom) \ - and not portdb.xmatch("bestmatch-visible", atom)): + if not pkg: if not (isinstance(arg, SetArg) and \ arg.name in ("system", "world")): self._show_unsatisfied_dep(myroot, atom) return 0, myfavorites self._missing_args.append((arg, atom)) continue + if pkg.installed: + # Warn if all matching ebuilds are masked or + # the installed package itself is masked. Do + # not warn if there are simply no matching + # ebuilds since that would be annoying in some + # cases: + # + # - binary packages installed from an overlay + # that is not listed in PORTDIR_OVERLAY + # + # - multi-slot atoms listed in the world file + # to prevent depclean from removing them + + installed_masked = not visible( + pkgsettings, pkg.cpv, pkg.metadata, + built=pkg.built, installed=pkg.installed) + + all_ebuilds_masked = bool( + portdb.xmatch("match-all", atom) and + not portdb.xmatch("bestmatch-visible", atom)) + + if installed_masked or all_ebuilds_masked: + self._missing_args.append((arg, atom)) + + if "selective" not in self.myparams: + self._show_unsatisfied_dep(myroot, atom) + return 0, myfavorites + self._dep_stack.append( Dependency(atom=atom, root=myroot, parent=arg)) if not self._create_graph(): -- cgit v1.2.3-1-g7c22