Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9666 - in main/branches/prefix: bin man pym/_emerge pym/portage pym/portage/elog pym/repoman
Date: Tue, 01 Apr 2008 18:14:02
Message-Id: E1Jgkze-0005B4-TL@stork.gentoo.org
1 Author: grobian
2 Date: 2008-04-01 18:13:57 +0000 (Tue, 01 Apr 2008)
3 New Revision: 9666
4
5 Modified:
6 main/branches/prefix/bin/ebuild.sh
7 main/branches/prefix/bin/misc-functions.sh
8 main/branches/prefix/bin/repoman
9 main/branches/prefix/man/make.conf.5
10 main/branches/prefix/man/repoman.1
11 main/branches/prefix/pym/_emerge/__init__.py
12 main/branches/prefix/pym/portage/__init__.py
13 main/branches/prefix/pym/portage/elog/mod_mail_summary.py
14 main/branches/prefix/pym/repoman/checks.py
15 main/branches/prefix/pym/repoman/errors.py
16 Log:
17 Merged from trunk 9583:9619
18
19 | 9584 | Bug #214691 - Move the "slot collision" display so that it |
20 | zmedico | is shown after the merge list where it is most likely to be |
21 | | seen (along with other depgraph problems). |
22
23 | 9585 | Add a new "java.eclassesnotused" check for cases where |
24 | zmedico | DEPEND contains virtual/jdk and and the appropriate java |
25 | | eclass has not been inherited (a violation of the java |
26 | | team's policy). Thanks to Betelgeuse for the initial patch. |
27
28 | 9586 | Don't trigger the 'java.eclassesnotused' on blocker atoms. |
29 | zmedico | |
30
31 | 9587 | Add a new "ebuild.patches" check for the PATCHES variable |
32 | zmedico | that's used by base_src_unpack() from base.eclass. This |
33 | | generates a warning if the variable is not defined as an |
34 | | array, since this is required for white space safety. Thanks |
35 | | to Betelgeuse for the initial patch. |
36
37 | 9588 | Bug #215240 - Use an alarm signal to implement a 60 second |
38 | zmedico | timeout in finalize() in case send_mail() blocks |
39 | | indefinitely. |
40
41 | 9589 | When a resume list contains packages that are no longer |
42 | zmedico | available, automatically delete it. |
43
44 | 9590 | Fix quoting for ${root} in install_mask(). |
45 | zmedico | |
46
47 | 9591 | Add a note about PKG_INSTALL_MASK. |
48 | zmedico | |
49
50 | 9592 | Bug #214619 - Run dyn_package() and preinst_mask() from ${T} |
51 | zmedico | instead of ${D} in order to avoid leaving gmon.out files in |
52 | | ${D} in case any tools were built with -pf in CFLAGS. Also, |
53 | | call preinst_mask() after all other functions so that |
54 | | INSTALL_MASK can be used to wipe out any gmon.out files |
55 | | created during previous functions. |
56
57 | 9606 | When dyn_unpack() automatically cleans ${WORKDIR}, also |
58 | zmedico | remove things like .unpacked and .compiled so that the state |
59 | | is consistent. |
60
61 | 9607 | Bug #215308 - Simplify the greedy atoms logic so that it |
62 | zmedico | behaves more like StaticFileSet and won't pull in lower |
63 | | slots. |
64
65 | 9611 | For bugs #197810 and #215308, pass the depgraph's |
66 | zmedico | "selective" parameter down into dep_check() for better atom |
67 | | preference selection when handling virtuals and other |
68 | | disjunctive || dependencies. (branches/2.1.2 r9610) |
69
70 | 9613 | Use enumerate() it iterate over an array. |
71 | zmedico | |
72
73 | 9615 | Bug #211365 - Use catpkgsplit() instead of pkgsplit() for a |
74 | zmedico | cpv. |
75
76 | 9616 | Make code a bit less prone to potentially hidden TypeError |
77 | zmedico | like bugs. |
78
79 | 9619 | Do not allow commit mode together with the --without-mask |
80 | zmedico | options. |
81
82
83 Modified: main/branches/prefix/bin/ebuild.sh
84 ===================================================================
85 --- main/branches/prefix/bin/ebuild.sh 2008-04-01 18:08:06 UTC (rev 9665)
86 +++ main/branches/prefix/bin/ebuild.sh 2008-04-01 18:13:57 UTC (rev 9666)
87 @@ -669,6 +669,7 @@
88 fi
89 if [ "${newstuff}" == "yes" ]; then
90 # We don't necessarily have privileges to do a full dyn_clean here.
91 + rm -rf "${PORTAGE_BUILDDIR}"/{.unpacked,.compiled,.tested,.packaged,build-info}
92 rm -rf "${WORKDIR}"
93 if [ -d "${T}" ] && \
94 ! hasq keeptemp $FEATURES && ! hasq keepwork $FEATURES ; then
95
96 Modified: main/branches/prefix/bin/misc-functions.sh
97 ===================================================================
98 --- main/branches/prefix/bin/misc-functions.sh 2008-04-01 18:08:06 UTC (rev 9665)
99 +++ main/branches/prefix/bin/misc-functions.sh 2008-04-01 18:13:57 UTC (rev 9666)
100 @@ -496,7 +496,7 @@
101 set +o noglob
102 quiet_mode || einfo "Removing ${no_inst}"
103 # normal stuff
104 - rm -Rf ${root}/${no_inst} >&/dev/null
105 + rm -Rf "${root}"/${no_inst} >&/dev/null
106
107 # we also need to handle globs (*.a, *.h, etc)
108 find "${root}" -path "${no_inst}" -exec rm -fR {} \; >/dev/null
109 @@ -529,6 +529,11 @@
110 eerror "${FUNCNAME}: D is unset"
111 return 1
112 fi
113 +
114 + # Make sure $PWD is not ${D} so that we don't leave gmon.out files
115 + # in there in case any tools were built with -pg in CFLAGS.
116 + cd "${T}"
117 +
118 # remove man pages, info pages, docs if requested
119 for f in man info doc; do
120 if hasq no${f} $FEATURES; then
121 @@ -649,7 +654,9 @@
122 }
123
124 dyn_package() {
125 - cd "${PORTAGE_BUILDDIR}/image"
126 + # Make sure $PWD is not ${D} so that we don't leave gmon.out files
127 + # in there in case any tools were built with -pg in CFLAGS.
128 + cd "${T}"
129 install_mask "${PORTAGE_BUILDDIR}/image" "${PKG_INSTALL_MASK}"
130 local tar_options=""
131 [ "${PORTAGE_QUIET}" == "1" ] || tar_options="${tar_options} -v"
132 @@ -659,10 +666,9 @@
133 [ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \
134 PORTAGE_BINPKG_TMPFILE="${PKGDIR}/${CATEGORY}/${PF}.tbz2"
135 mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
136 - tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS . | \
137 + tar $tar_options -cf - $PORTAGE_BINPKG_TAR_OPTS -C "${D}" . | \
138 bzip2 -f > "$PORTAGE_BINPKG_TMPFILE" || \
139 die "Failed to create tarball"
140 - cd ..
141 export PYTHONPATH=${PORTAGE_PYM_PATH:-${EPREFIX}/usr/lib/portage/pym}
142 python -c "from portage import xpak; t=xpak.tbz2('${PORTAGE_BINPKG_TMPFILE}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
143 if [ $? -ne 0 ]; then
144
145 Modified: main/branches/prefix/bin/repoman
146 ===================================================================
147 --- main/branches/prefix/bin/repoman 2008-04-01 18:08:06 UTC (rev 9665)
148 +++ main/branches/prefix/bin/repoman 2008-04-01 18:13:57 UTC (rev 9666)
149 @@ -187,7 +187,7 @@
150 default=False, help='ignore masked packages (not allowed with commit mode)')
151
152 parser.add_option('--without-mask', dest='without_mask', action='store_true',
153 - default=False, help='behave as if no package.mask entries exist')
154 + default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)')
155
156 parser.add_option('--mode', type='choice', dest='mode', choices=modes.keys(),
157 help='specify which mode repoman will run in (default=full)')
158 @@ -220,8 +220,11 @@
159 if not opts.mode:
160 opts.mode = 'full' #default to full
161
162 - if opts.mode == 'commit' and opts.ignore_masked:
163 - parser.error('Commit mode and --ignore_masked are not compatable')
164 + if opts.mode == 'commit' and not (opts.force or opts.pretend):
165 + if opts.ignore_masked:
166 + parser.error('Commit mode and --ignore-masked are not compatable')
167 + if opts.without_mask:
168 + parser.error('Commit mode and --without-mask are not compatable')
169
170 # Use the verbosity and quiet options to fiddle with the loglevel appropriately
171 for val in range(opts.verbosity):
172 @@ -242,12 +245,14 @@
173 "changelog.missing":"Missing ChangeLog files",
174 "ebuild.disjointed":"Ebuilds not added to cvs when the matching digest has been added",
175 "ebuild.notadded":"Ebuilds that exist but have not been added to cvs",
176 + "ebuild.patches":"PATCHES variable should be a bash array to ensure white space safety",
177 "changelog.notadded":"ChangeLogs that exist but have not been added to cvs",
178 "filedir.missing":"Package lacks a files directory",
179 "file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do note need the executable bit",
180 "file.size":"Files in the files directory must be under 20k",
181 "file.name":"File/dir name must be composed of only the following chars: %s " % allowed_filename_chars,
182 "file.UTF8":"File is not UTF8 compliant",
183 + "java.eclassesnotused":"With virtual/jdk in DEPEND you must inherit a java eclass",
184 "KEYWORDS.dropped":"Ebuilds that appear to have dropped KEYWORDS for some arch",
185 "KEYWORDS.missing":"Ebuilds that have a missing or empty KEYWORDS variable",
186 "KEYWORDS.stable":"Ebuilds that have been added directly with stable KEYWORDS",
187 @@ -323,7 +328,9 @@
188 "RESTRICT.invalid",
189 "ebuild.minorsyn",
190 "ebuild.badheader",
191 +"ebuild.patches",
192 "file.size",
193 +"java.eclassesnotused",
194 "metadata.missing",
195 "metadata.bad",
196 "virtual.versioned",
197 @@ -1025,6 +1032,7 @@
198
199 myaux = ebuild_metadata[y]
200 eapi = myaux["EAPI"]
201 + inherited = myaux["INHERITED"].split()
202
203 # Test for negative logic and bad words in the RESTRICT var.
204 #for x in myaux[allvars.index("RESTRICT")].split():
205 @@ -1157,6 +1165,7 @@
206 myflag = myflag[1:]
207 myiuse.add(myflag)
208
209 + inherited_java_eclass = "java-pkg" in inherited
210 operator_tokens = set(["||", "(", ")"])
211 type_list, badsyntax = [], []
212 for mytype in ("DEPEND", "RDEPEND", "PDEPEND", "LICENSE", "PROVIDE"):
213 @@ -1204,7 +1213,16 @@
214 if not portage.isvalidatom(token, allow_blockers=True):
215 badsyntax.append("'%s' not a valid atom" % token)
216 else:
217 - atom = token.lstrip("!")
218 + atom = token
219 + is_blocker = atom.startswith("!")
220 + if is_blocker:
221 + atom = token.lstrip("!")
222 + if mytype == "DEPEND" and \
223 + not is_blocker and \
224 + not inherited_java_eclass and \
225 + portage.dep_getkey(atom) == "virtual/jdk":
226 + stats['java.eclassesnotused'] += 1
227 + fails['java.eclassesnotused'].append(relative_path)
228 if eapi == "0":
229 if portage.dep.dep_getslot(atom):
230 stats['EAPI.incompatible'] += 1
231
232 Modified: main/branches/prefix/man/make.conf.5
233 ===================================================================
234 --- main/branches/prefix/man/make.conf.5 2008-04-01 18:08:06 UTC (rev 9665)
235 +++ main/branches/prefix/man/make.conf.5 2008-04-01 18:13:57 UTC (rev 9666)
236 @@ -332,7 +332,10 @@
237 Use this variable if you want to selectively prevent certain files from being
238 copied into your file system tree. This does not work on symlinks, but only on
239 actual files. Useful if you wish to filter out files like HACKING.gz and
240 -TODO.gz.
241 +TODO.gz. The \fBINSTALL_MASK\fR is processed just before a package is merged.
242 +Also supported is a \fBPKG_INSTALL_MASK\fR variable that behaves exactly like
243 +\fBINSTALL_MASK\fR except that it is processed just before creation of a binary
244 +package.
245 .TP
246 .B MAKEOPTS
247 Use this variable if you want to use parallel make. For example, if you
248
249 Modified: main/branches/prefix/man/repoman.1
250 ===================================================================
251 --- main/branches/prefix/man/repoman.1 2008-04-01 18:08:06 UTC (rev 9665)
252 +++ main/branches/prefix/man/repoman.1 2008-04-01 18:13:57 UTC (rev 9666)
253 @@ -41,7 +41,7 @@
254 Ignore masked packages (not allowed with commit mode)
255 .TP
256 \fB\-\-without\-mask\fR
257 -Behave as if no package.mask entries exist
258 +Behave as if no package.mask entries exist (not allowed with commit mode)
259 .TP
260 \fB-m\fR, \fB--commitmsg\fR
261 Adds a commit message via the command line
262 @@ -219,6 +219,9 @@
263 .B ebuild.output
264 A simple sourcing of the ebuild produces output; this breaks ebuild policy.
265 .TP
266 +.B ebuild.patches
267 +PATCHES variable should be a bash array to ensure white space safety
268 +.TP
269 .B ebuild.syntax
270 Error generating cache entry for ebuild; typically caused by ebuild syntax error
271 or digest verification failure.
272 @@ -238,6 +241,10 @@
273 .B filedir.missing
274 Package lacks a files directory
275 .TP
276 +.B java.eclassesnotused
277 +With virtual/jdk in DEPEND you must inherit a java eclass. Refer to
278 +\fIhttp://www.gentoo.org/proj/en/java/java\-devel.xml\fR for more information.
279 +.TP
280 .B metadata.bad
281 Bad metadata.xml files
282 .TP
283
284 Modified: main/branches/prefix/pym/_emerge/__init__.py
285 ===================================================================
286 --- main/branches/prefix/pym/_emerge/__init__.py 2008-04-01 18:08:06 UTC (rev 9665)
287 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-04-01 18:13:57 UTC (rev 9666)
288 @@ -1547,6 +1547,7 @@
289 self._pprovided_args = []
290 self._missing_args = []
291 self._masked_installed = []
292 + self._unsatisfied_deps_for_display = []
293 self._dep_stack = []
294 self._unsatisfied_deps = []
295 self._ignored_deps = []
296 @@ -1561,6 +1562,9 @@
297 already been selected) will be required in order to handle all possible
298 cases."""
299
300 + if not self._slot_collision_info:
301 + return
302 +
303 msg = []
304 msg.append("\n!!! Multiple versions within a single " + \
305 "package slot have been \n")
306 @@ -1694,8 +1698,8 @@
307 if allow_unsatisfied:
308 self._unsatisfied_deps.append(dep)
309 continue
310 - self._show_unsatisfied_dep(dep.root, dep.atom,
311 - myparent=dep.parent)
312 + self._unsatisfied_deps_for_display.append(
313 + ((dep.root, dep.atom), {"myparent":dep.parent}))
314 return 0
315 # In some cases, dep_check will return deps that shouldn't
316 # be proccessed any further, so they are identified and
317 @@ -2002,29 +2006,12 @@
318 myslots = set()
319 for cpv in vardb.match(mykey):
320 myslots.add(vardb.aux_get(cpv, ["SLOT"])[0])
321 - if myslots:
322 - self._populate_filtered_repo(root, atom,
323 - exclude_installed=True)
324 - mymatches = filtered_db.match(atom)
325 - best_pkg = portage.best(mymatches)
326 - if best_pkg:
327 - best_slot = filtered_db.aux_get(best_pkg, ["SLOT"])[0]
328 - myslots.add(best_slot)
329 - if len(myslots) > 1:
330 - for myslot in myslots:
331 - myslot_atom = "%s:%s" % (mykey, myslot)
332 - self._populate_filtered_repo(
333 - root, myslot_atom,
334 - exclude_installed=True)
335 - if filtered_db.match(myslot_atom):
336 - yield myslot_atom
337 + for myslot in myslots:
338 + yield "%s:%s" % (mykey, myslot)
339 + # In addition to any installed slots, also try to pull
340 + # in the latest new slot that may be available.
341 + yield atom
342
343 - # Since populate_filtered_repo() was called with the
344 - # exclude_installed flag, these atoms will need to be processed
345 - # again in case installed packages are required to satisfy
346 - # dependencies.
347 - self._filtered_trees[root]["atoms"].clear()
348 -
349 def _iter_args_for_pkg(self, pkg):
350 # TODO: add multiple $ROOT support
351 if pkg.root != self.target_root:
352 @@ -2310,12 +2297,14 @@
353 if not pkg:
354 if not (isinstance(arg, SetArg) and \
355 arg.name in ("system", "world")):
356 - self._show_unsatisfied_dep(myroot, atom)
357 + self._unsatisfied_deps_for_display.append(
358 + ((myroot, atom), {}))
359 return 0, myfavorites
360 self._missing_args.append((arg, atom))
361 continue
362 if pkg.installed and "selective" not in self.myparams:
363 - self._show_unsatisfied_dep(myroot, atom)
364 + self._unsatisfied_deps_for_display.append(
365 + ((myroot, atom), {}))
366 return 0, myfavorites
367
368 self._dep_stack.append(
369 @@ -2516,12 +2505,14 @@
370 myuse=myuse, strict=strict)
371 if True:
372 try:
373 + self.trees[root]["selective"] = "selective" in self.myparams
374 if not strict:
375 portage.dep._dep_check_strict = False
376 mycheck = portage.dep_check(depstring, None,
377 pkgsettings, myuse=myuse,
378 myroot=root, trees=trees)
379 finally:
380 + self.trees[root]["selective"] = False
381 portage.dep._dep_check_strict = True
382 if not mycheck[0]:
383 raise portage.exception.InvalidDependString(mycheck[1])
384 @@ -3122,8 +3113,8 @@
385 # unresolvable blocks.
386 for x in self.altlist():
387 if x[0] == "blocks":
388 + self._slot_collision_info.clear()
389 return True
390 - self._show_slot_collision_notice()
391 if not self._accept_collisions():
392 return False
393 return True
394 @@ -3716,7 +3707,7 @@
395
396 #we need to use "--emptrytree" testing here rather than "empty" param testing because "empty"
397 #param is used for -u, where you still *do* want to see when something is being upgraded.
398 - myoldbest = ""
399 + myoldbest = []
400 myinslotlist = None
401 installed_versions = vardb.match(portage.cpv_getkey(pkg_key))
402 if vardb.cpv_exists(pkg_key):
403 @@ -3739,9 +3730,10 @@
404 portage.cpv_getkey(pkg_key):
405 myinslotlist = None
406 if myinslotlist:
407 - myoldbest = portage.best(myinslotlist)
408 + myoldbest = myinslotlist[:]
409 addl = " " + fetch
410 - if portage.pkgcmp(portage.pkgsplit(x[2]), portage.pkgsplit(myoldbest)) < 0:
411 + if not portage.dep.cpvequal(pkg_key,
412 + portage.best([pkg_key] + myoldbest)):
413 # Downgrade in slot
414 addl += turquoise("U")+blue("D")
415 if ordered:
416 @@ -3789,7 +3781,7 @@
417 cur_use = [flag for flag in cur_use if flag in cur_iuse]
418
419 if myoldbest and myinslotlist:
420 - pkg = myoldbest
421 + pkg = myoldbest[0]
422 else:
423 pkg = x[2]
424 if self.trees[x[1]]["vartree"].dbapi.cpv_exists(pkg):
425 @@ -3950,17 +3942,17 @@
426
427 indent = " " * depth
428
429 - if myoldbest:
430 - if myinslotlist:
431 - myoldbest = [myoldbest]
432 - for key in myoldbest:
433 - pos = myoldbest.index(key)
434 - key = portage.pkgsplit(key)[1] + "-" + portage.pkgsplit(key)[2]
435 + # Convert myoldbest from a list to a string.
436 + if not myoldbest:
437 + myoldbest = ""
438 + else:
439 + for pos, key in enumerate(myoldbest):
440 + key = portage.catpkgsplit(key)[2] + \
441 + "-" + portage.catpkgsplit(key)[3]
442 if key[-3:] == "-r0":
443 key = key[:-3]
444 myoldbest[pos] = key
445 myoldbest = blue("["+", ".join(myoldbest)+"]")
446 -
447
448 pkg_cp = xs[0]
449 root_config = self.roots[myroot]
450 @@ -4079,6 +4071,20 @@
451 print bold('*'+revision)
452 sys.stdout.write(text)
453
454 + self.display_problems()
455 + return os.EX_OK
456 +
457 + def display_problems(self):
458 + """
459 + Display problems with the dependency graph such as slot collisions.
460 + This is called internally by display() to show the problems _after_
461 + the merge list where it is most likely to be seen, but if display()
462 + is not going to be called then this method should be called explicitly
463 + to ensure that the user is notified of problems with the graph.
464 + """
465 +
466 + self._show_slot_collision_notice()
467 +
468 # TODO: Add generic support for "set problem" handlers so that
469 # the below warnings aren't special cases for world only.
470
471 @@ -4154,8 +4160,10 @@
472 msg.append("The best course of action depends on the reason that an offending\n")
473 msg.append("package.provided entry exists.\n\n")
474 sys.stderr.write("".join(msg))
475 - return os.EX_OK
476
477 + for pargs, kwargs in self._unsatisfied_deps_for_display:
478 + self._show_unsatisfied_dep(*pargs, **kwargs)
479 +
480 def calc_changelog(self,ebuildpath,current,next):
481 if ebuildpath == None or not os.path.exists(ebuildpath):
482 return []
483 @@ -6883,6 +6891,10 @@
484 merge_count = 0
485 pretend = "--pretend" in myopts
486 fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
487 + ask = "--ask" in myopts
488 + tree = "--tree" in myopts
489 + verbose = "--verbose" in myopts
490 + quiet = "--quiet" in myopts
491 if pretend or fetchonly:
492 # make the mtimedb readonly
493 mtimedb.filename = None
494 @@ -6968,6 +6980,8 @@
495 out.eerror("Error: The resume list contains packages that are no longer")
496 out.eerror(" available to be emerged. Please restart/continue")
497 out.eerror(" the merge operation manually.")
498 + del mtimedb["resume"]
499 + mtimedb.commit()
500 return 1
501 if show_spinner:
502 print "\b\b... done!"
503 @@ -6987,9 +7001,14 @@
504 portage.writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
505 return 1
506 if not retval:
507 + mydepgraph.display_problems()
508 return 1
509 if "--quiet" not in myopts and "--nodeps" not in myopts:
510 print "\b\b... done!"
511 + display = pretend or \
512 + ((ask or tree or verbose) and not (quiet and not ask))
513 + if not display:
514 + mydepgraph.display_problems()
515
516 if "--pretend" not in myopts and \
517 ("--ask" in myopts or "--tree" in myopts or \
518
519 Modified: main/branches/prefix/pym/portage/__init__.py
520 ===================================================================
521 --- main/branches/prefix/pym/portage/__init__.py 2008-04-01 18:08:06 UTC (rev 9665)
522 +++ main/branches/prefix/pym/portage/__init__.py 2008-04-01 18:13:57 UTC (rev 9666)
523 @@ -4755,11 +4755,14 @@
524 phase_retval = exit_status_check(phase_retval)
525 if phase_retval == os.EX_OK:
526 # Post phase logic and tasks that have been factored out of
527 - # ebuild.sh.
528 + # ebuild.sh. Call preinst_mask last so that INSTALL_MASK can
529 + # can be used to wipe out any gmon.out files created during
530 + # previous functions (in case any tools were built with -pg
531 + # in CFLAGS).
532 myargs = [_shell_quote(misc_sh_binary),
533 - "preinst_bsdflags", "preinst_mask",
534 + "preinst_bsdflags",
535 "preinst_sfperms", "preinst_selinux_labels",
536 - "preinst_suid_scan"]
537 + "preinst_suid_scan", "preinst_mask"]
538 _doebuild_exit_status_unlink(
539 mysettings.get("EBUILD_EXIT_STATUS_FILE"))
540 mysettings["EBUILD_PHASE"] = ""
541 @@ -5363,6 +5366,7 @@
542 if trees is None:
543 global db
544 trees = db
545 + selective = trees[myroot].get("selective", False)
546 writemsg("ZapDeps -- %s\n" % (use_binaries), 2)
547 if not reduced or unreduced == ["||"] or dep_eval(reduced):
548 return []
549 @@ -5426,7 +5430,7 @@
550 has_mask = False
551 if hasattr(mydbapi, "xmatch"):
552 has_mask = bool(mydbapi.xmatch("match-all", atom))
553 - if (use_binaries or not has_mask):
554 + if (selective or use_binaries or not has_mask):
555 avail_pkg = best(vardb.match(atom))
556 if avail_pkg:
557 avail_slot = "%s:%s" % (dep_getkey(atom),
558
559 Modified: main/branches/prefix/pym/portage/elog/mod_mail_summary.py
560 ===================================================================
561 --- main/branches/prefix/pym/portage/elog/mod_mail_summary.py 2008-04-01 18:08:06 UTC (rev 9665)
562 +++ main/branches/prefix/pym/portage/elog/mod_mail_summary.py 2008-04-01 18:13:57 UTC (rev 9666)
563 @@ -51,8 +51,19 @@
564
565 mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject,
566 mybody, attachments=items.values())
567 +
568 + def timeout_handler(signum, frame):
569 + raise PortageException("Timeout in finalize() for elog system 'mail_summary'")
570 + import signal
571 + signal.signal(signal.SIGALRM, timeout_handler)
572 + # Timeout after one minute in case send_mail() blocks indefinitely.
573 + signal.alarm(60)
574 +
575 try:
576 - portage.mail.send_mail(mysettings, mymessage)
577 + try:
578 + portage.mail.send_mail(mysettings, mymessage)
579 + finally:
580 + signal.alarm(0)
581 except PortageException, e:
582 writemsg("%s\n" % str(e), noiselevel=-1)
583
584
585 Modified: main/branches/prefix/pym/repoman/checks.py
586 ===================================================================
587 --- main/branches/prefix/pym/repoman/checks.py 2008-04-01 18:08:06 UTC (rev 9665)
588 +++ main/branches/prefix/pym/repoman/checks.py 2008-04-01 18:13:57 UTC (rev 9666)
589 @@ -18,9 +18,9 @@
590
591 def check(self, num, line):
592 """Run the check on line and return error if there is one"""
593 - pass
594 + if self.re.match(line):
595 + return self.error
596
597 -
598 class EbuildHeader(LineCheck):
599 """Ensure ebuilds have proper headers
600 Copyright header errors
601 @@ -191,6 +191,11 @@
602 elif self.method_re.match(line):
603 self.check_next_line = True
604
605 +class EbuildPatches(LineCheck):
606 + """Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
607 + repoman_check_name = 'ebuild.patches'
608 + re = re.compile(r'^\s*PATCHES=[^\(]')
609 + error = errors.PATCHES_ERROR
610
611 class EbuildQuotedA(LineCheck):
612 """Ensure ebuilds have no quoting around ${A}"""
613 @@ -206,7 +211,8 @@
614 _constant_checks = tuple((c() for c in (
615 EbuildWhitespace, EbuildQuote,
616 EbuildAssignment, EbuildUselessDodoc,
617 - EbuildUselessCdS, EbuildNestedDie, EbuildQuotedA)))
618 + EbuildUselessCdS, EbuildNestedDie,
619 + EbuildPatches, EbuildQuotedA)))
620
621 def run_checks(contents, st_mtime):
622 checks = list(_constant_checks)
623
624 Modified: main/branches/prefix/pym/repoman/errors.py
625 ===================================================================
626 --- main/branches/prefix/pym/repoman/errors.py 2008-04-01 18:08:06 UTC (rev 9665)
627 +++ main/branches/prefix/pym/repoman/errors.py 2008-04-01 18:13:57 UTC (rev 9666)
628 @@ -11,4 +11,5 @@
629 READONLY_ASSIGNMENT_ERROR = 'Ebuild contains assignment to read-only variable on line: %d'
630 MISSING_QUOTES_ERROR = 'Unquoted Variable on line: %d'
631 NESTED_DIE_ERROR = 'Ebuild calls die in a subshell on line: %d'
632 +PATCHES_ERROR = 'PATCHES is not a bash array on line: %d'
633 REDUNDANT_CD_S_ERROR = 'Ebuild has redundant cd ${S} statement on line: %d'
634
635 --
636 gentoo-commits@l.g.o mailing list