Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12346 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/portage/dbapi
Date: Thu, 25 Dec 2008 13:42:31
Message-Id: E1LFqTt-0002TY-8x@stork.gentoo.org
1 Author: grobian
2 Date: 2008-12-25 13:42:28 +0000 (Thu, 25 Dec 2008)
3 New Revision: 12346
4
5 Modified:
6 main/branches/prefix/bin/ebuild
7 main/branches/prefix/bin/emerge
8 main/branches/prefix/bin/prepstrip
9 main/branches/prefix/bin/repoman
10 main/branches/prefix/man/ebuild.5
11 main/branches/prefix/man/make.conf.5
12 main/branches/prefix/pym/_emerge/__init__.py
13 main/branches/prefix/pym/portage/__init__.py
14 main/branches/prefix/pym/portage/dbapi/bintree.py
15 Log:
16 Merged from trunk -r12288:12302
17
18 | 12289 | Rename the PollTask class to AbstractPollTask. |
19 | zmedico | |
20
21 | 12290 | Move initial signal handlers to the launcher script. |
22 | zmedico | |
23
24 | 12291 | Make more code conditional on POLLIN events, where |
25 | zmedico | appropriate. |
26
27 | 12292 | Add SIGUSR1 signal handlers that call pdb.set_trace(). |
28 | zmedico | Thanks to Brian Harring for the suggestion. |
29
30 | 12293 | Bug #252304 - Restore the -V/--version option. |
31 | zmedico | |
32
33 | 12294 | Fix broken PATH comparisons when eliminating duplicate |
34 | zmedico | entries inside binarytree.inject(). |
35
36 | 12295 | Fix PATH comparison in binarytree.inject() some more. |
37 | zmedico | |
38
39 | 12296 | Bug #251976 - Add a QA_PRESTRIPPED variable for ebuilds to |
40 | zmedico | disable warnings about pre-stripped files. |
41
42 | 12297 | Replace QA_DT_HASH with QA_PRESTRIPPED where appropriate. |
43 | zmedico | Thanks to Arfrever for reporting. Also, remove array support |
44 | | since bash arrays don't export anyway. |
45
46 | 12298 | Fix typo. |
47 | zmedico | |
48
49 | 12299 | Document QA_STRICT_PRESTRIPPED. |
50 | zmedico | |
51
52 | 12300 | Don't use 'local' builtin outside of a function. |
53 | zmedico | |
54
55 | 12301 | Bug #252374 - Warn if FEATURES=fakeroot is enabled, but the |
56 | zmedico | fakeroot binary is not installed. |
57
58 | 12302 | Make BinpkgFetcher use longs instead of floats when |
59 | zmedico | synchronizing timestamps, since it's better not to rely on |
60 | | float comparison here. |
61
62
63 Modified: main/branches/prefix/bin/ebuild
64 ===================================================================
65 --- main/branches/prefix/bin/ebuild 2008-12-25 11:10:19 UTC (rev 12345)
66 +++ main/branches/prefix/bin/ebuild 2008-12-25 13:42:28 UTC (rev 12346)
67 @@ -19,6 +19,11 @@
68 except KeyboardInterrupt:
69 sys.exit(1)
70
71 +def debug_signal(signum, frame):
72 + import pdb
73 + pdb.set_trace()
74 +signal.signal(signal.SIGUSR1, debug_signal)
75 +
76 import optparse
77 import os
78
79 @@ -167,6 +172,7 @@
80 finally:
81 portage._doebuild_manifest_exempt_depend -= 1
82
83 +portage.settings.validate() # generate warning messages if necessary
84 tmpsettings = portage.config(clone=portage.settings)
85 if "test" in pargs:
86 # This variable is a signal to config.regenerate() to
87
88 Modified: main/branches/prefix/bin/emerge
89 ===================================================================
90 --- main/branches/prefix/bin/emerge 2008-12-25 11:10:19 UTC (rev 12345)
91 +++ main/branches/prefix/bin/emerge 2008-12-25 13:42:28 UTC (rev 12346)
92 @@ -3,7 +3,29 @@
93 # Portage Emerge bits
94 # $Id$
95
96 +import os
97 +import sys
98 +# This block ensures that ^C interrupts are handled quietly.
99 +try:
100 + import signal
101
102 + def exithandler(signum,frame):
103 + signal.signal(signal.SIGINT, signal.SIG_IGN)
104 + signal.signal(signal.SIGTERM, signal.SIG_IGN)
105 + sys.exit(1)
106 +
107 + signal.signal(signal.SIGINT, exithandler)
108 + signal.signal(signal.SIGTERM, exithandler)
109 + signal.signal(signal.SIGPIPE, signal.SIG_DFL)
110 +
111 +except KeyboardInterrupt:
112 + sys.exit(1)
113 +
114 +def debug_signal(signum, frame):
115 + import pdb
116 + pdb.set_trace()
117 +signal.signal(signal.SIGUSR1, debug_signal)
118 +
119 # for an explanation on this logic, see pym/_emerge/__init__.py
120 import os
121 import sys
122
123 Modified: main/branches/prefix/bin/prepstrip
124 ===================================================================
125 --- main/branches/prefix/bin/prepstrip 2008-12-25 11:10:19 UTC (rev 12345)
126 +++ main/branches/prefix/bin/prepstrip 2008-12-25 13:42:28 UTC (rev 12346)
127 @@ -80,12 +80,25 @@
128 # They prevent us from getting the splitdebug data.
129 if ! hasq binchecks ${RESTRICT} && \
130 ! hasq strip ${RESTRICT} ; then
131 - f=$(scanelf -yqRBF '#k%F' -k '!.symtab' "$@")
132 - if [[ -n ${f} ]] ; then
133 + log=$T/scanelf-already-stripped.log
134 + scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^$D##" > "$log"
135 + if [[ -n $QA_PRESTRIPPED && -s $log && \
136 + ${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
137 + shopts=$-
138 + set -o noglob
139 + for x in $QA_PRESTRIPPED ; do
140 + sed -e "s#^${x#/}\$##" -i "$log"
141 + done
142 + set +o noglob
143 + set -$shopts
144 + fi
145 + sed -e "/^\$/d" -e "s#^#/#" -i "$log"
146 + if [[ -s $log ]] ; then
147 vecho -e "\a\n"
148 eqawarn "QA Notice: Pre-stripped files found:"
149 - eqawarn "${f}"
150 - echo "${f}" > "${T}"/scanelf-already-stripped.log
151 + eqawarn "$(<"$log")"
152 + else
153 + rm -f "$log"
154 fi
155 fi
156
157
158 Modified: main/branches/prefix/bin/repoman
159 ===================================================================
160 --- main/branches/prefix/bin/repoman 2008-12-25 11:10:19 UTC (rev 12345)
161 +++ main/branches/prefix/bin/repoman 2008-12-25 13:42:28 UTC (rev 12346)
162 @@ -175,6 +175,9 @@
163 parser.add_option('-v', '--verbose', dest="verbosity", action='count',
164 help='be very verbose in output', default=0)
165
166 + parser.add_option('-V', '--version', dest='version', action='store_true',
167 + help='show version info')
168 +
169 parser.add_option('-x', '--xmlparse', dest='xml_parse', action='store_true',
170 default=False, help='forces the metadata.xml parse check to be carried out')
171
172 @@ -421,6 +424,10 @@
173
174 options, arguments = ParseArgs(sys.argv, qahelp)
175
176 +if options.version:
177 + print "Portage", portage.VERSION
178 + sys.exit(0)
179 +
180 # Set this to False when an extraordinary issue (generally
181 # something other than a QA issue) makes it impossible to
182 # commit (like if Manifest generation fails).
183
184 Modified: main/branches/prefix/man/ebuild.5
185 ===================================================================
186 --- main/branches/prefix/man/ebuild.5 2008-12-25 11:10:19 UTC (rev 12345)
187 +++ main/branches/prefix/man/ebuild.5 2008-12-25 13:42:28 UTC (rev 12346)
188 @@ -500,6 +500,11 @@
189 This should contain a list of file paths, relative to the image directory, of
190 files that contain .hash sections. The paths may contain regular expressions
191 with escape\-quoted special characters.
192 +.TP
193 +\fBQA_PRESTRIPPED\fR
194 +This should contain a list of file paths, relative to the image directory, of
195 +files that contain pre-stripped binaries. The paths may contain regular
196 +expressions with escape\-quoted special characters.
197 .SH "PORTAGE DECLARATIONS"
198 .TP
199 .B inherit
200
201 Modified: main/branches/prefix/man/make.conf.5
202 ===================================================================
203 --- main/branches/prefix/man/make.conf.5 2008-12-25 11:10:19 UTC (rev 12345)
204 +++ main/branches/prefix/man/make.conf.5 2008-12-25 13:42:28 UTC (rev 12346)
205 @@ -595,6 +595,10 @@
206 Set this to cause portage to ignore any \fIQA_DT_HASH\fR override
207 settings from ebuilds. See also \fBebuild\fR(5).
208 .TP
209 +\fBQA_STRICT_PRESTRIPPED = \fI"set"\fR
210 +Set this to cause portage to ignore any \fIQA_PRESTRIPPED\fR override
211 +settings from ebuilds. See also \fBebuild\fR(5).
212 +.TP
213 .B RESUMECOMMAND
214 This variable contains the command used for resuming package sources that
215 have been partially downloaded. It should be defined using the same format
216
217 Modified: main/branches/prefix/pym/_emerge/__init__.py
218 ===================================================================
219 --- main/branches/prefix/pym/_emerge/__init__.py 2008-12-25 11:10:19 UTC (rev 12345)
220 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-12-25 13:42:28 UTC (rev 12346)
221 @@ -3,23 +3,6 @@
222 # Distributed under the terms of the GNU General Public License v2
223 # $Id$
224
225 -import sys
226 -# This block ensures that ^C interrupts are handled quietly.
227 -try:
228 - import signal
229 -
230 - def exithandler(signum,frame):
231 - signal.signal(signal.SIGINT, signal.SIG_IGN)
232 - signal.signal(signal.SIGTERM, signal.SIG_IGN)
233 - sys.exit(1)
234 -
235 - signal.signal(signal.SIGINT, exithandler)
236 - signal.signal(signal.SIGTERM, exithandler)
237 - signal.signal(signal.SIGPIPE, signal.SIG_DFL)
238 -
239 -except KeyboardInterrupt:
240 - sys.exit(1)
241 -
242 import array
243 from collections import deque
244 import fcntl
245 @@ -28,6 +11,8 @@
246 import select
247 import shlex
248 import shutil
249 +import signal
250 +import sys
251 import textwrap
252 import urlparse
253 import weakref
254 @@ -1791,7 +1776,7 @@
255 while self._exit_listener_stack:
256 self._exit_listener_stack.pop()(self)
257
258 -class PollTask(AsynchronousTask):
259 +class AbstractPollTask(AsynchronousTask):
260
261 __slots__ = ("scheduler",) + \
262 ("_registered",)
263 @@ -1801,6 +1786,9 @@
264 _registered_events = PollConstants.POLLIN | PollConstants.POLLHUP | \
265 _exceptional_events
266
267 + def _unregister(self):
268 + raise NotImplementedError(self)
269 +
270 def _unregister_if_appropriate(self, event):
271 if self._registered:
272 if event & self._exceptional_events:
273 @@ -1810,7 +1798,7 @@
274 self._unregister()
275 self.wait()
276
277 -class PipeReader(PollTask):
278 +class PipeReader(AbstractPollTask):
279
280 """
281 Reads output from one or more files and saves it in memory,
282 @@ -1861,23 +1849,24 @@
283 self._read_data = None
284
285 def _output_handler(self, fd, event):
286 - files = self.input_files
287 - for f in files.itervalues():
288 - if fd == f.fileno():
289 - break
290
291 - buf = array.array('B')
292 if event & PollConstants.POLLIN:
293 +
294 + for f in self.input_files.itervalues():
295 + if fd == f.fileno():
296 + break
297 +
298 + buf = array.array('B')
299 try:
300 buf.fromfile(f, self._bufsize)
301 except EOFError:
302 pass
303
304 - if buf:
305 - self._read_data.append(buf.tostring())
306 - else:
307 - self._unregister()
308 - self.wait()
309 + if buf:
310 + self._read_data.append(buf.tostring())
311 + else:
312 + self._unregister()
313 + self.wait()
314
315 self._unregister_if_appropriate(event)
316 return self._registered
317 @@ -2048,7 +2037,7 @@
318 self._final_exit(task)
319 self.wait()
320
321 -class SubProcess(PollTask):
322 +class SubProcess(AbstractPollTask):
323
324 __slots__ = ("pid",) + \
325 ("_files", "_reg_id")
326 @@ -2272,23 +2261,26 @@
327 return portage.process.spawn(args, **kwargs)
328
329 def _output_handler(self, fd, event):
330 - files = self._files
331 - buf = array.array('B')
332 +
333 if event & PollConstants.POLLIN:
334 +
335 + files = self._files
336 + buf = array.array('B')
337 try:
338 buf.fromfile(files.process, self._bufsize)
339 except EOFError:
340 pass
341 - if buf:
342 - if not self.background:
343 - buf.tofile(files.stdout)
344 - files.stdout.flush()
345 - buf.tofile(files.log)
346 - files.log.flush()
347 - else:
348 - self._unregister()
349 - self.wait()
350
351 + if buf:
352 + if not self.background:
353 + buf.tofile(files.stdout)
354 + files.stdout.flush()
355 + buf.tofile(files.log)
356 + files.log.flush()
357 + else:
358 + self._unregister()
359 + self.wait()
360 +
361 self._unregister_if_appropriate(event)
362 return self._registered
363
364 @@ -2298,19 +2290,21 @@
365 the only purpose of the pipe is to allow the scheduler to
366 monitor the process from inside a poll() loop.
367 """
368 - files = self._files
369 - buf = array.array('B')
370 +
371 if event & PollConstants.POLLIN:
372 +
373 + buf = array.array('B')
374 try:
375 - buf.fromfile(files.process, self._bufsize)
376 + buf.fromfile(self._files.process, self._bufsize)
377 except EOFError:
378 pass
379 - if buf:
380 - pass
381 - else:
382 - self._unregister()
383 - self.wait()
384
385 + if buf:
386 + pass
387 + else:
388 + self._unregister()
389 + self.wait()
390 +
391 self._unregister_if_appropriate(event)
392 return self._registered
393
394 @@ -2934,9 +2928,10 @@
395 portage.process.spawned_pids.remove(self.pid)
396
397 def _output_handler(self, fd, event):
398 - files = self._files
399 +
400 if event & PollConstants.POLLIN:
401 - self._raw_metadata.append(files.ebuild.read())
402 + self._raw_metadata.append(self._files.ebuild.read())
403 +
404 if not self._raw_metadata[-1] or event & PollConstants.POLLHUP:
405 # Split lines here so they can be counted inside _set_returncode().
406 self._raw_metadata = "".join(self._raw_metadata).splitlines()
407 @@ -3567,12 +3562,12 @@
408 remote_mtime = bintree._remotepkgs[self.pkg.cpv].get("MTIME")
409 if remote_mtime is not None:
410 try:
411 - remote_mtime = float(remote_mtime)
412 + remote_mtime = long(remote_mtime)
413 except ValueError:
414 pass
415 else:
416 try:
417 - local_mtime = os.stat(self.pkg_path).st_mtime
418 + local_mtime = long(os.stat(self.pkg_path).st_mtime)
419 except OSError:
420 pass
421 else:
422
423 Modified: main/branches/prefix/pym/portage/__init__.py
424 ===================================================================
425 --- main/branches/prefix/pym/portage/__init__.py 2008-12-25 11:10:19 UTC (rev 12345)
426 +++ main/branches/prefix/pym/portage/__init__.py 2008-12-25 13:42:28 UTC (rev 12346)
427 @@ -1815,6 +1815,11 @@
428 writemsg("!!! /etc/portage/profile/virtuals. Please move it to\n")
429 writemsg("!!! this new location.\n\n")
430
431 + if "fakeroot" in self.features and \
432 + not portage.process.fakeroot_capable:
433 + writemsg("!!! FEATURES=fakeroot is enabled, but the " + \
434 + "fakeroot binary is not installed.\n", noiselevel=-1)
435 +
436 def loadVirtuals(self,root):
437 """Not currently used by portage."""
438 writemsg("DEPRECATED: portage.config.loadVirtuals\n")
439
440 Modified: main/branches/prefix/pym/portage/dbapi/bintree.py
441 ===================================================================
442 --- main/branches/prefix/pym/portage/dbapi/bintree.py 2008-12-25 11:10:19 UTC (rev 12345)
443 +++ main/branches/prefix/pym/portage/dbapi/bintree.py 2008-12-25 13:42:28 UTC (rev 12346)
444 @@ -871,14 +871,14 @@
445 return
446
447 # If found, remove package(s) with duplicate path.
448 - path = d.get("PATH")
449 + path = d.get("PATH", "")
450 for i in xrange(len(pkgindex.packages) - 1, -1, -1):
451 d2 = pkgindex.packages[i]
452 - if path is not None and path == d2.get("PATH"):
453 + if path and path == d2.get("PATH"):
454 # Handle path collisions in $PKGDIR/All
455 # when CPV is not identical.
456 del pkgindex.packages[i]
457 - elif cpv == d2.get("CPV") and path == d2.get("PATH"):
458 + elif cpv == d2.get("CPV") and path == d2.get("PATH", ""):
459 del pkgindex.packages[i]
460 pkgindex.packages.append(d)