Bug #208708 - Fix masked package display some more:
authorZac Medico <zmedico@gentoo.org>
Fri, 8 Feb 2008 08:39:58 +0000 (08:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 8 Feb 2008 08:39:58 +0000 (08:39 -0000)
- 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

index 12922636ae8181f9bbb287a19a5bf8f6ea52c6a6..5be88735d0e51bba4092c1fa7570b9a05927167c 100644 (file)
@@ -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():