Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12561 - in main/branches/prefix: bin man pym/_emerge pym/repoman
Date: Fri, 30 Jan 2009 21:20:58
Message-Id: E1LT0nH-0002kI-VP@stork.gentoo.org
1 Author: grobian
2 Date: 2009-01-30 21:20:54 +0000 (Fri, 30 Jan 2009)
3 New Revision: 12561
4
5 Modified:
6 main/branches/prefix/bin/repoman
7 main/branches/prefix/man/repoman.1
8 main/branches/prefix/pym/_emerge/__init__.py
9 main/branches/prefix/pym/repoman/checks.py
10 Log:
11 Merged from trunk -r12528:12543
12
13 | 12529 | Bug #255358 - Add new RDEPEND.implicit warning to detect the |
14 | zmedico | caes where DEPEND is set and RDEPEND is unset in the ebuild, |
15 | | since this triggers implicit RDEPEND=$DEPEND assignment. |
16
17 | 12540 | When in --keep-going mode, don't suppress the list of failed |
18 | zmedico | packages display at the end when there is only one failure, |
19 | | since the failure may have occurred much earlier and the |
20 | | related output may not be visible any longer. |
21
22 | 12541 | Inside depgraph.loadResumeCommand(), ignore unsatisified |
23 | zmedico | dependencies that are pulled in by installed packages. This |
24 | | is needed in order to avoid having --keep-going bail out |
25 | | needlessly when one of a group of circularly dependent |
26 | | packages fails to install after one or more of the group |
27 | | have already been installed. TODO: Add sanity checks to make |
28 | | sure that it's really safe to ignore all the deps that can |
29 | | be ignored by this code. |
30
31 | 12542 | In depgraph.loadResumeCommand(), account for unsatisfied |
32 | zmedico | dependencies of installed packages if they are in the |
33 | | subgraph of dependencies of a package which is scheduled to |
34 | | be installed. |
35
36 | 12543 | Bug #199408 - Always enable the skip_masked and |
37 | zmedico | skip_unsatisfied for the resume_depgraph() function. This |
38 | | will cause emerge --resume to automatically drop masked |
39 | | packages (without the need to specify --skipfirst). |
40
41
42 Modified: main/branches/prefix/bin/repoman
43 ===================================================================
44 --- main/branches/prefix/bin/repoman 2009-01-29 18:34:39 UTC (rev 12560)
45 +++ main/branches/prefix/bin/repoman 2009-01-30 21:20:54 UTC (rev 12561)
46 @@ -303,6 +303,7 @@
47 "IUSE.undefined":"This ebuild does not define IUSE (style guideline says to define IUSE even when empty)",
48 "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
49 "KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
50 + "RDEPEND.implicit":"RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment",
51 "RDEPEND.suspect":"RDEPEND contains a package that usually only belongs in DEPEND.",
52 "RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.",
53 "digestentry.unused":"Some files listed in the Manifest aren't referenced in SRC_URI",
54 @@ -343,6 +344,7 @@
55 "KEYWORDS.missing",
56 "IUSE.invalid",
57 "IUSE.undefined",
58 +"RDEPEND.implicit",
59 "RDEPEND.suspect",
60 "RESTRICT.invalid",
61 "SRC_URI.mirror",
62
63 Modified: main/branches/prefix/man/repoman.1
64 ===================================================================
65 --- main/branches/prefix/man/repoman.1 2009-01-29 18:34:39 UTC (rev 12560)
66 +++ main/branches/prefix/man/repoman.1 2009-01-30 21:20:54 UTC (rev 12561)
67 @@ -168,6 +168,10 @@
68 .B RDEPEND.badmaskedindev
69 Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch
70 .TP
71 +.B RDEPEND.implicit
72 +RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND
73 +assignment
74 +.TP
75 .B RDEPEND.suspect
76 RDEPEND contains a package that usually only belongs in DEPEND
77 .TP
78
79 Modified: main/branches/prefix/pym/_emerge/__init__.py
80 ===================================================================
81 --- main/branches/prefix/pym/_emerge/__init__.py 2009-01-29 18:34:39 UTC (rev 12560)
82 +++ main/branches/prefix/pym/_emerge/__init__.py 2009-01-30 21:20:54 UTC (rev 12561)
83 @@ -8550,13 +8550,43 @@
84 # masked.
85 if not self._create_graph(allow_unsatisfied=True):
86 return False
87 - if masked_tasks or self._unsatisfied_deps:
88 +
89 + unsatisfied_deps = []
90 + for dep in self._unsatisfied_deps:
91 + if not isinstance(dep.parent, Package):
92 + continue
93 + if dep.parent.operation == "merge":
94 + unsatisfied_deps.append(dep)
95 + continue
96 +
97 + # For unsatisfied deps of installed packages, only account for
98 + # them if they are in the subgraph of dependencies of a package
99 + # which is scheduled to be installed.
100 + unsatisfied_install = False
101 + traversed = set()
102 + dep_stack = self.digraph.parent_nodes(dep.parent)
103 + while dep_stack:
104 + node = dep_stack.pop()
105 + if not isinstance(node, Package):
106 + continue
107 + if node.operation == "merge":
108 + unsatisfied_install = True
109 + break
110 + if node in traversed:
111 + continue
112 + traversed.add(node)
113 + dep_stack.extend(self.digraph.parent_nodes(node))
114 +
115 + if unsatisfied_install:
116 + unsatisfied_deps.append(dep)
117 +
118 + if masked_tasks or unsatisfied_deps:
119 # This probably means that a required package
120 # was dropped via --skipfirst. It makes the
121 # resume list invalid, so convert it to a
122 # UnsatisfiedResumeDep exception.
123 raise self.UnsatisfiedResumeDep(self,
124 - masked_tasks + self._unsatisfied_deps)
125 + masked_tasks + unsatisfied_deps)
126 self._serialized_tasks_cache = None
127 try:
128 self.altlist()
129 @@ -10399,7 +10429,8 @@
130 for msg in self._post_mod_echo_msgs:
131 msg()
132
133 - if len(self._failed_pkgs_all) > 1:
134 + if len(self._failed_pkgs_all) > 1 or \
135 + (self._failed_pkgs_all and "--keep-going" in self.myopts):
136 msg = "The following packages have " + \
137 "failed to build or install:"
138 prefix = bad(" * ")
139 @@ -10878,7 +10909,7 @@
140 try:
141 success, mydepgraph, dropped_tasks = resume_depgraph(
142 self.settings, self.trees, self._mtimedb, self.myopts,
143 - myparams, self._spinner, skip_unsatisfied=True)
144 + myparams, self._spinner)
145 except depgraph.UnsatisfiedResumeDep, e:
146 mydepgraph = e.depgraph
147 dropped_tasks = set()
148 @@ -13719,14 +13750,15 @@
149 else:
150 print "Number removed: "+str(len(cleanlist))
151
152 -def resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner,
153 - skip_masked=False, skip_unsatisfied=False):
154 +def resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner):
155 """
156 Construct a depgraph for the given resume list. This will raise
157 PackageNotFound or depgraph.UnsatisfiedResumeDep when necessary.
158 @rtype: tuple
159 @returns: (success, depgraph, dropped_tasks)
160 """
161 + skip_masked = True
162 + skip_unsatisfied = True
163 mergelist = mtimedb["resume"]["mergelist"]
164 dropped_tasks = set()
165 while True:
166 @@ -13929,14 +13961,11 @@
167 del mergelist[i]
168 break
169
170 - skip_masked = "--skipfirst" in myopts
171 - skip_unsatisfied = "--skipfirst" in myopts
172 success = False
173 mydepgraph = None
174 try:
175 success, mydepgraph, dropped_tasks = resume_depgraph(
176 - settings, trees, mtimedb, myopts, myparams, spinner,
177 - skip_masked=skip_masked, skip_unsatisfied=skip_unsatisfied)
178 + settings, trees, mtimedb, myopts, myparams, spinner)
179 except (portage.exception.PackageNotFound,
180 depgraph.UnsatisfiedResumeDep), e:
181 if isinstance(e, depgraph.UnsatisfiedResumeDep):
182
183 Modified: main/branches/prefix/pym/repoman/checks.py
184 ===================================================================
185 --- main/branches/prefix/pym/repoman/checks.py 2009-01-29 18:34:39 UTC (rev 12560)
186 +++ main/branches/prefix/pym/repoman/checks.py 2009-01-30 21:20:54 UTC (rev 12561)
187 @@ -230,6 +230,33 @@
188 if match:
189 return "Quoted \"${A}\" on line: %d"
190
191 +class ImplicitRuntimeDeps(LineCheck):
192 + """
193 + Detect the case where DEPEND is set and RDEPEND is unset in the ebuild,
194 + since this triggers implicit RDEPEND=$DEPEND assignment.
195 + """
196 +
197 + repoman_check_name = 'RDEPEND.implicit'
198 + _assignment_re = re.compile(r'^\s*(R?DEPEND)=')
199 +
200 + def new(self, pkg):
201 + self._rdepend = False
202 + self._depend = False
203 +
204 + def check(self, num, line):
205 + if not self._rdepend:
206 + m = self._assignment_re.match(line)
207 + if m is None:
208 + pass
209 + elif m.group(1) == "RDEPEND":
210 + self._rdepend = True
211 + elif m.group(1) == "DEPEND":
212 + self._depend = True
213 +
214 + def end(self):
215 + if self._depend and not self._rdepend:
216 + yield 'RDEPEND is not explicitly assigned'
217 +
218 class InheritAutotools(LineCheck):
219 """
220 Make sure appropriate functions are called in
221 @@ -306,7 +333,7 @@
222 EbuildAssignment, EbuildUselessDodoc,
223 EbuildUselessCdS, EbuildNestedDie,
224 EbuildPatches, EbuildQuotedA,
225 - IUseUndefined, InheritAutotools,
226 + IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
227 EMakeParallelDisabled, DeprecatedBindnowFlags)))
228
229 def run_checks(contents, pkg):