1 |
Author: grobian |
2 |
Date: 2008-10-03 16:58:09 +0000 (Fri, 03 Oct 2008) |
3 |
New Revision: 11616 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/ebuild.sh |
7 |
main/branches/prefix/bin/repoman |
8 |
main/branches/prefix/man/repoman.1 |
9 |
main/branches/prefix/pym/_emerge/__init__.py |
10 |
main/branches/prefix/pym/portage/elog/__init__.py |
11 |
Log: |
12 |
Merged from trunk -r11602:11613 |
13 |
|
14 |
| 11603 | Generate an eqawarn message if econf is called from | |
15 |
| zmedico | src_compile and src_configure is also defined. Thanks to | |
16 |
| | Betelgeuse for the patch which I've modified to be silent in | |
17 |
| | EAPI 0 or 1 in case ebuilds want to define src_configure in | |
18 |
| | those EAPIs and call it manually from src_compile. | |
19 |
|
20 |
| 11604 | Bug #239272 - Handle InvalidAtom exception inside | |
21 |
| zmedico | depgraph.validate_blockers(). | |
22 |
|
23 |
| 11605 | When parsing PORTAGE_ELOG_SYSTEM, stack values in a dict so | |
24 |
| zmedico | that things like "echo:info echo:qa" stack like one might | |
25 |
| | expect. Thanks to Betelgeuse for reporting. | |
26 |
|
27 |
| 11606 | Call elog_process before calling the "clean" phase for | |
28 |
| zmedico | --buildpkgonly mode. | |
29 |
|
30 |
| 11607 | Fix broken logic in Scheduler._main_loop() which would allow | |
31 |
| zmedico | the main loop to exit while one or more merges are still | |
32 |
| | scheduled. Thanks to Patrick Lauer for reporting. | |
33 |
|
34 |
| 11608 | Optimize display_preserved_libs() by using a single | |
35 |
| zmedico | getFileOwnerMap() to look up all the files. | |
36 |
|
37 |
| 11609 | In JobStatusDisplay._update(), set _displayed = True when | |
38 |
| zmedico | ruturning early due to stdout not being a tty. This fixes a | |
39 |
| | problem excess output which was reported by Daniel Robbins. | |
40 |
|
41 |
| 11610 | Implement a new "changelog.ebuildadded" check which causes | |
42 |
| zmedico | repoman to bail out if an ebuild has been added and the | |
43 |
| | ChangeLog has not been modified. This was requested by Robin | |
44 |
| | H Johnson <robbat2@g.o> since it is a requirement for the | |
45 |
| | packages.gentoo.org ChangeLog code. | |
46 |
|
47 |
| 11611 | Remove pointless copying of the owners dict inside | |
48 |
| zmedico | display_preserved_libs(). | |
49 |
|
50 |
| 11613 | Fix `svn status` output parsing for compatibility with | |
51 |
| zmedico | subversion-1.6. Thanks to Arfrever for this patch. | |
52 |
|
53 |
|
54 |
Modified: main/branches/prefix/bin/ebuild.sh |
55 |
=================================================================== |
56 |
--- main/branches/prefix/bin/ebuild.sh 2008-10-03 16:53:25 UTC (rev 11615) |
57 |
+++ main/branches/prefix/bin/ebuild.sh 2008-10-03 16:58:09 UTC (rev 11616) |
58 |
@@ -436,6 +436,10 @@ |
59 |
local x |
60 |
local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}" |
61 |
|
62 |
+ ! hasq "$EAPI" 0 1 && [[ $EBUILD_PHASE = compile && \ |
63 |
+ $(type -t src_configure) = function ]] && \ |
64 |
+ eqawarn "econf called in src_compile instead of src_configure" |
65 |
+ |
66 |
if [ -z "${ECONF_SOURCE}" ]; then |
67 |
ECONF_SOURCE="." |
68 |
fi |
69 |
|
70 |
Modified: main/branches/prefix/bin/repoman |
71 |
=================================================================== |
72 |
--- main/branches/prefix/bin/repoman 2008-10-03 16:53:25 UTC (rev 11615) |
73 |
+++ main/branches/prefix/bin/repoman 2008-10-03 16:58:09 UTC (rev 11616) |
74 |
@@ -22,7 +22,7 @@ |
75 |
import time |
76 |
import platform |
77 |
|
78 |
-from itertools import izip |
79 |
+from itertools import chain, izip |
80 |
from stat import S_ISDIR, ST_CTIME |
81 |
|
82 |
try: |
83 |
@@ -249,6 +249,7 @@ |
84 |
"desktop.invalid":"desktop-file-validate reports errors in a *.desktop file", |
85 |
"ebuild.invalidname":"Ebuild files with a non-parseable or syntactically incorrect name (or using 2.1 versioning extensions)", |
86 |
"ebuild.namenomatch":"Ebuild files that do not have the same name as their parent directory", |
87 |
+ "changelog.ebuildadded":"An ebuild was added but the ChangeLog was not modified", |
88 |
"changelog.missing":"Missing ChangeLog files", |
89 |
"ebuild.notadded":"Ebuilds that exist but have not been added to cvs", |
90 |
"ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety", |
91 |
@@ -743,11 +744,21 @@ |
92 |
print green("\nRepoMan scours the neighborhood...") |
93 |
|
94 |
new_ebuilds = set() |
95 |
+modified_changelogs = set() |
96 |
if vcs == "cvs": |
97 |
mycvstree = cvstree.getentries("./", recursive=1) |
98 |
+ mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./") |
99 |
mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./") |
100 |
+ |
101 |
+if vcs == "svn": |
102 |
+ svnstatus = os.popen("svn status").readlines() |
103 |
+ mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ] |
104 |
+ mynew = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ] |
105 |
+ |
106 |
+if vcs: |
107 |
new_ebuilds.update(x for x in mynew if x.endswith(".ebuild")) |
108 |
- del mycvstree, mynew |
109 |
+ modified_changelogs.update(x for x in chain(mychanged, mynew) \ |
110 |
+ if os.path.basename(x) == "ChangeLog") |
111 |
|
112 |
have_masked = False |
113 |
dofail = 0 |
114 |
@@ -1026,11 +1037,29 @@ |
115 |
|
116 |
del metadata_bad |
117 |
|
118 |
+ changelog_path = "ChangeLog" |
119 |
+ if repolevel < 3: |
120 |
+ changelog_path = os.path.join(pkgdir, changelog_path) |
121 |
+ if repolevel < 2: |
122 |
+ changelog_path = os.path.join(catdir, changelog_path) |
123 |
+ changelog_path = os.path.join(".", changelog_path) |
124 |
+ changelog_modified = changelog_path in modified_changelogs |
125 |
+ |
126 |
allmasked = True |
127 |
|
128 |
for y in ebuildlist: |
129 |
relative_path = os.path.join(x, y + ".ebuild") |
130 |
full_path = os.path.join(repodir, relative_path) |
131 |
+ ebuild_path = y + ".ebuild" |
132 |
+ if repolevel < 3: |
133 |
+ ebuild_path = os.path.join(pkgdir, ebuild_path) |
134 |
+ if repolevel < 2: |
135 |
+ ebuild_path = os.path.join(catdir, ebuild_path) |
136 |
+ ebuild_path = os.path.join(".", ebuild_path) |
137 |
+ if not changelog_modified and ebuild_path in new_ebuilds: |
138 |
+ stats['changelog.ebuildadded'] += 1 |
139 |
+ fails['changelog.ebuildadded'].append(relative_path) |
140 |
+ |
141 |
if stat.S_IMODE(os.stat(full_path).st_mode) & 0111: |
142 |
stats["file.executable"] += 1 |
143 |
fails["file.executable"].append(x+"/"+y+".ebuild") |
144 |
@@ -1119,12 +1148,6 @@ |
145 |
not keyword.startswith("-"): |
146 |
stable_keywords.append(keyword) |
147 |
if stable_keywords: |
148 |
- ebuild_path = y + ".ebuild" |
149 |
- if repolevel < 3: |
150 |
- ebuild_path = os.path.join(pkgdir, ebuild_path) |
151 |
- if repolevel < 2: |
152 |
- ebuild_path = os.path.join(catdir, ebuild_path) |
153 |
- ebuild_path = os.path.join(".", ebuild_path) |
154 |
if ebuild_path in new_ebuilds: |
155 |
stable_keywords.sort() |
156 |
stats["KEYWORDS.stable"] += 1 |
157 |
@@ -1674,9 +1697,10 @@ |
158 |
sys.exit(1) |
159 |
|
160 |
if vcs == "cvs": |
161 |
- mycvstree=portage.cvstree.getentries("./",recursive=1) |
162 |
- mychanged=portage.cvstree.findchanged(mycvstree,recursive=1,basedir="./") |
163 |
- mynew=portage.cvstree.findnew(mycvstree,recursive=1,basedir="./") |
164 |
+ if myautoadd: |
165 |
+ mycvstree = cvstree.getentries("./", recursive=1) |
166 |
+ mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./") |
167 |
+ mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./") |
168 |
myremoved=portage.cvstree.findremoved(mycvstree,recursive=1,basedir="./") |
169 |
bin_blob_pattern = re.compile("^-kb$") |
170 |
no_expansion = set(portage.cvstree.findoption(mycvstree, bin_blob_pattern, |
171 |
@@ -1684,10 +1708,11 @@ |
172 |
|
173 |
|
174 |
if vcs == "svn": |
175 |
- svnstatus = os.popen("svn status").readlines() |
176 |
- mychanged = [ elem.rstrip()[7:] for elem in svnstatus if elem and elem[:1] in "MR" ] |
177 |
- mynew = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("A") ] |
178 |
- myremoved = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("D") ] |
179 |
+ if myautoadd: |
180 |
+ svnstatus = os.popen("svn status").readlines() |
181 |
+ mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ] |
182 |
+ mynew = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ] |
183 |
+ myremoved = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("D") ] |
184 |
# in contrast to CVS, SVN expands nothing by default. |
185 |
# bin_blobs historically |
186 |
# were just there to see what files need to be checked for |
187 |
@@ -1699,7 +1724,7 @@ |
188 |
# For files with multiple props set, props are delimited by newlines, |
189 |
# so exclude lines that don't contain " - " since each of those lines |
190 |
# only a contain props for a file listed on a previous line. |
191 |
- expansion = set(prop.split(" - ")[0] \ |
192 |
+ expansion = set("./" + prop.split(" - ")[0] \ |
193 |
for prop in props if " - " in prop) |
194 |
|
195 |
if vcs: |
196 |
|
197 |
Modified: main/branches/prefix/man/repoman.1 |
198 |
=================================================================== |
199 |
--- main/branches/prefix/man/repoman.1 2008-10-03 16:53:25 UTC (rev 11615) |
200 |
+++ main/branches/prefix/man/repoman.1 2008-10-03 16:58:09 UTC (rev 11616) |
201 |
@@ -183,6 +183,9 @@ |
202 |
.B SRC_URI.mirror |
203 |
A uri listed in profiles/thirdpartymirrors is found in SRC_URI |
204 |
.TP |
205 |
+.B changelog.ebuildadded |
206 |
+An ebuild was added but the ChangeLog was not modified |
207 |
+.TP |
208 |
.B changelog.missing |
209 |
Missing ChangeLog files |
210 |
.TP |
211 |
|
212 |
Modified: main/branches/prefix/pym/_emerge/__init__.py |
213 |
=================================================================== |
214 |
--- main/branches/prefix/pym/_emerge/__init__.py 2008-10-03 16:53:25 UTC (rev 11615) |
215 |
+++ main/branches/prefix/pym/_emerge/__init__.py 2008-10-03 16:58:09 UTC (rev 11616) |
216 |
@@ -2565,6 +2565,7 @@ |
217 |
if self._default_exit(packager) == os.EX_OK and \ |
218 |
self.opts.buildpkgonly: |
219 |
# Need to call "clean" phase for buildpkgonly mode |
220 |
+ portage.elog.elog_process(self.pkg.cpv, self.settings) |
221 |
phase = "clean" |
222 |
clean_phase = EbuildPhase(background=self.background, |
223 |
pkg=self.pkg, phase=phase, |
224 |
@@ -5921,10 +5922,16 @@ |
225 |
blocker_cache[cpv] = \ |
226 |
blocker_cache.BlockerData(counter, blocker_atoms) |
227 |
if blocker_atoms: |
228 |
- for myatom in blocker_atoms: |
229 |
- blocker = Blocker(atom=portage.dep.Atom(myatom), |
230 |
- eapi=pkg.metadata["EAPI"], root=myroot) |
231 |
- self._blocker_parents.add(blocker, pkg) |
232 |
+ try: |
233 |
+ for atom in blocker_atoms: |
234 |
+ blocker = Blocker(atom=portage.dep.Atom(atom), |
235 |
+ eapi=pkg.metadata["EAPI"], root=myroot) |
236 |
+ self._blocker_parents.add(blocker, pkg) |
237 |
+ except portage.exception.InvalidAtom, e: |
238 |
+ depstr = " ".join(vardb.aux_get(pkg.cpv, dep_keys)) |
239 |
+ show_invalid_depstring_notice( |
240 |
+ pkg, depstr, "Invalid Atom: %s" % (e,)) |
241 |
+ return False |
242 |
for cpv in stale_cache: |
243 |
del blocker_cache[cpv] |
244 |
blocker_cache.flush() |
245 |
@@ -8750,6 +8757,7 @@ |
246 |
out = self.out |
247 |
if not self._isatty: |
248 |
out.write(self._format_msg(msg) + self._term_codes['newline']) |
249 |
+ self._displayed = True |
250 |
return |
251 |
|
252 |
if self._displayed: |
253 |
@@ -9892,7 +9900,7 @@ |
254 |
|
255 |
while True: |
256 |
self._schedule() |
257 |
- if not self._jobs or merge_queue: |
258 |
+ if not (self._jobs or merge_queue): |
259 |
break |
260 |
if self._poll_event_handlers: |
261 |
self._poll_loop() |
262 |
@@ -10942,13 +10950,25 @@ |
263 |
print colorize("WARN", "!!!") + " existing preserved libs:" |
264 |
plibdata = vardbapi.plib_registry.getPreservedLibs() |
265 |
linkmap = vardbapi.linkmap |
266 |
+ |
267 |
+ consumer_map = {} |
268 |
+ search_for_owners = set() |
269 |
for cpv in plibdata: |
270 |
+ for f in plibdata[cpv]: |
271 |
+ if f in consumer_map: |
272 |
+ continue |
273 |
+ consumers = list(linkmap.findConsumers(f)) |
274 |
+ consumers.sort() |
275 |
+ consumer_map[f] = consumers |
276 |
+ search_for_owners.update(consumers[:MAX_DISPLAY+1]) |
277 |
+ |
278 |
+ owners = vardbapi._owners.getFileOwnerMap(search_for_owners) |
279 |
+ |
280 |
+ for cpv in plibdata: |
281 |
print colorize("WARN", ">>>") + " package: %s" % cpv |
282 |
for f in plibdata[cpv]: |
283 |
print colorize("WARN", " * ") + " - %s" % f |
284 |
- consumers = list(linkmap.findConsumers(f)) |
285 |
- consumers.sort() |
286 |
- owners = vardbapi._owners.getFileOwnerMap(consumers[:MAX_DISPLAY+2]) |
287 |
+ consumers = consumer_map[f] |
288 |
for c in consumers[:MAX_DISPLAY]: |
289 |
print colorize("WARN", " * ") + " used by %s (%s)" % (c, ", ".join([x.mycpv for x in owners[c]])) |
290 |
if len(consumers) == MAX_DISPLAY + 1: |
291 |
|
292 |
Modified: main/branches/prefix/pym/portage/elog/__init__.py |
293 |
=================================================================== |
294 |
--- main/branches/prefix/pym/portage/elog/__init__.py 2008-10-03 16:53:25 UTC (rev 11615) |
295 |
+++ main/branches/prefix/pym/portage/elog/__init__.py 2008-10-03 16:58:09 UTC (rev 11616) |
296 |
@@ -91,6 +91,19 @@ |
297 |
all_logentries[key], _preserve_logentries[key] = phasefilter(all_logentries[key]) |
298 |
|
299 |
my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split()) |
300 |
+ logsystems = {} |
301 |
+ for token in mysettings.get("PORTAGE_ELOG_SYSTEM", "").split(): |
302 |
+ if ":" in token: |
303 |
+ s, levels = token.split(":", 1) |
304 |
+ levels = levels.split(",") |
305 |
+ else: |
306 |
+ s = token |
307 |
+ levels = () |
308 |
+ levels_set = logsystems.get(s) |
309 |
+ if levels_set is None: |
310 |
+ levels_set = set() |
311 |
+ logsystems[s] = levels_set |
312 |
+ levels_set.update(levels) |
313 |
|
314 |
for key in all_logentries: |
315 |
default_logentries = filter_loglevels(all_logentries[key], my_elog_classes) |
316 |
@@ -106,12 +119,9 @@ |
317 |
default_logentries, default_fulllog) |
318 |
|
319 |
# pass the processing to the individual modules |
320 |
- logsystems = mysettings["PORTAGE_ELOG_SYSTEM"].split() |
321 |
- for s in logsystems: |
322 |
+ for s, levels in logsystems.iteritems(): |
323 |
# allow per module overrides of PORTAGE_ELOG_CLASSES |
324 |
- if ":" in s: |
325 |
- s, levels = s.split(":", 1) |
326 |
- levels = levels.split(",") |
327 |
+ if levels: |
328 |
mod_logentries = filter_loglevels(all_logentries[key], levels) |
329 |
mod_fulllog = _combine_logentries(mod_logentries) |
330 |
else: |