Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10466 - in main/branches/2.1.2: bin pym
Date: Wed, 28 May 2008 08:52:11
Message-Id: E1K1HOC-0004pJ-Bg@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-28 08:52:07 +0000 (Wed, 28 May 2008)
3 New Revision: 10466
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 main/branches/2.1.2/pym/portage.py
8 Log:
9 Bug #223447 - Adjust the "installed packages are masked" display to recognize
10 packages that are masked by keywords and are eligible for uninstallation by
11 depclean. This is a workaround for the fact that depclean may fail to
12 recognize that the package is eligible for uninstall due to differences in
13 visibility filtering which can lead to differences in || dep evaluation.
14 TODO: Share visibility code to fix this inconsistency. (trunk r10465)
15
16
17 Modified: main/branches/2.1.2/bin/emerge
18 ===================================================================
19 --- main/branches/2.1.2/bin/emerge 2008-05-28 08:31:06 UTC (rev 10465)
20 +++ main/branches/2.1.2/bin/emerge 2008-05-28 08:52:07 UTC (rev 10466)
21 @@ -2110,7 +2110,7 @@
22 self._displayed_list = None
23 self._pprovided_args = []
24 self._missing_args = []
25 - self._masked_installed = []
26 + self._masked_installed = set()
27 self._unsatisfied_deps_for_display = []
28 self._unsatisfied_blockers_for_display = None
29 self._circular_deps_for_display = None
30 @@ -2419,12 +2419,6 @@
31 del e
32 return 0
33
34 - if pkg.installed:
35 - # Warn if an installed package is masked and it
36 - # is pulled into the graph.
37 - if not visible(pkgsettings, pkg):
38 - self._masked_installed.append((pkg, pkgsettings))
39 -
40 if args:
41 self._set_nodes.add(pkg)
42
43 @@ -3496,11 +3490,51 @@
44 portdb = self.trees[myroot]["porttree"].dbapi
45 pkgsettings = self.pkgsettings[myroot]
46 final_db = self.mydbapi[myroot]
47 +
48 + graph_complete_for_root = "complete" in self.myparams or \
49 + (myroot == self.target_root and \
50 + ("deep" in self.myparams or "empty" in self.myparams) and \
51 + not self._required_set_names.difference(self._sets))
52 +
53 blocker_cache = BlockerCache(myroot, vardb)
54 stale_cache = set(blocker_cache)
55 for pkg in vardb:
56 cpv = pkg.cpv
57 stale_cache.discard(cpv)
58 +
59 + # Check for masked installed packages. For keyword
60 + # mask there are a couple of common cases that are
61 + # likely to generate unwanted noise:
62 + #
63 + # * Packages missing /var/db/pkg/*/*/KEYWORDS entries
64 + # due to having been installed by an old version of
65 + # portage.
66 + #
67 + # * Packages installed by overriding ACCEPT_KEYWORDS
68 + # via the environment.
69 + #
70 + # To avoid unwanted noise, only warn about keyword
71 + # masks if all of the following are true:
72 + #
73 + # * KEYWORDS is not empty (not installed by old portage).
74 + #
75 + # * The graph is complete and the package has not been
76 + # pulled into the dependency graph. It's eligible for
77 + # depclean, but depclean may fail to recognize it as
78 + # such due to differences in visibility filtering which
79 + # can lead to differences in || dep evaluation.
80 + # TODO: Share visibility code to fix this inconsistency.
81 +
82 + if pkg in final_db:
83 + if not visible(pkgsettings, pkg):
84 + self._masked_installed.add(pkg)
85 + elif graph_complete_for_root and \
86 + pkgsettings._getMissingKeywords(
87 + pkg.cpv, pkg.metadata) and \
88 + pkg.metadata["KEYWORDS"].split() and \
89 + not self.digraph.contains(pkg):
90 + self._masked_installed.add(pkg)
91 +
92 blocker_atoms = None
93 blockers = None
94 if self.digraph.contains(pkg):
95 @@ -5166,8 +5200,9 @@
96 sys.stderr.write("".join(msg))
97
98 masked_packages = []
99 - for pkg, pkgsettings in self._masked_installed:
100 - root_config = self.roots[pkg.root]
101 + for pkg in self._masked_installed:
102 + root_config = pkg.root_config
103 + pkgsettings = root_config.settings
104 mreasons = get_masking_status(pkg, pkgsettings, root_config)
105 masked_packages.append((root_config, pkgsettings,
106 pkg.cpv, pkg.metadata, mreasons))
107
108 Modified: main/branches/2.1.2/pym/portage.py
109 ===================================================================
110 --- main/branches/2.1.2/pym/portage.py 2008-05-28 08:31:06 UTC (rev 10465)
111 +++ main/branches/2.1.2/pym/portage.py 2008-05-28 08:52:07 UTC (rev 10466)
112 @@ -6163,9 +6163,9 @@
113 kmask="~"+myarch
114 break
115
116 - # Assume that the user doesn't want to be bothered about
117 - # KEYWORDS of packages that are already installed.
118 - if kmask and not installed:
119 + # Only show KEYWORDS masks for installed packages
120 + # if they're not masked for any other reason.
121 + if kmask and (not installed or not rValue):
122 rValue.append(kmask+" keyword")
123 return rValue
124
125
126 --
127 gentoo-commits@l.g.o mailing list