diff --git a/infrastructure/bin/dpb b/infrastructure/bin/dpb index 02cacf59f4e..bb2c9b602d1 100755 --- a/infrastructure/bin/dpb +++ b/infrastructure/bin/dpb @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: dpb,v 1.2 2010/08/20 15:22:21 espie Exp $ +# $OpenBSD: dpb,v 1.3 2010/10/24 10:01:57 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -43,7 +43,7 @@ use OpenBSD::Paths; my $make = $ENV{MAKE} || OpenBSD::Paths->make; our ($opt_t, $opt_e, $opt_T, $opt_c, $opt_h, $opt_A, $opt_j, $opt_a, - $opt_r, $opt_s, $opt_u, $opt_U, + $opt_q, $opt_r, $opt_s, $opt_u, $opt_U, $opt_L, $opt_m, $opt_f, $opt_x); my @subdirlist; @@ -107,7 +107,7 @@ $ui->{opt} = { parse_size_file(shift, $heuristics); } }; -$ui->handle_options('acersuUh:xA:f:j:m:P:b:L:S:t:T:', +$ui->handle_options('aceqrsuUh:xA:f:j:m:P:b:L:S:t:T:', "[-acersuUx] [-A arch] [-j N] [-P plist] [-h hosts] [-L logdir]", "[-b log] [-t ctimeout] [-T dtimeout] [-m threshold] [path ...]"); @@ -247,15 +247,21 @@ $engine->check_buildable; DPB::Core->start_clock($opt_T); while (1) { - handle_non_waiting_jobs(0); - if (!DPB::Core->running && (!$keep_going || !$engine->can_build)) { - $engine->check_buildable; - if (!$engine->can_build) { - last; + while (1) { + handle_non_waiting_jobs(0); + if (!DPB::Core->running && + (!$keep_going || !$engine->can_build)) { + $engine->check_buildable; + if (!$engine->can_build) { + last; + } + } + if (DPB::Core->running) { + DPB::Core->reap_wait; } } - if (DPB::Core->running) { - DPB::Core->reap_wait; + if (!$opt_q || !$engine->has_errors) { + last; } } diff --git a/infrastructure/lib/DPB/Engine.pm b/infrastructure/lib/DPB/Engine.pm index ab9b2675739..5866bd75e7a 100644 --- a/infrastructure/lib/DPB/Engine.pm +++ b/infrastructure/lib/DPB/Engine.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Engine.pm,v 1.4 2010/10/23 21:46:03 espie Exp $ +# $OpenBSD: Engine.pm,v 1.5 2010/10/24 10:01:57 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -42,6 +42,16 @@ sub new return $o; } +sub has_errors +{ + my $self = shift; + if (@{$self->{errors}} != 0) { + $self->{locker}->recheck_errors($self); + return 1; + } + return 0; +} + sub log_no_ts { my ($self, $kind, $v, $extra) = @_; diff --git a/infrastructure/man/man1/dpb.1 b/infrastructure/man/man1/dpb.1 index c9010b04aca..6e70737ecb4 100644 --- a/infrastructure/man/man1/dpb.1 +++ b/infrastructure/man/man1/dpb.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: dpb.1,v 1.4 2010/10/23 18:14:19 espie Exp $ +.\" $OpenBSD: dpb.1,v 1.5 2010/10/24 10:01:57 espie Exp $ .\" .\" Copyright (c) 2010 Marc Espie .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 23 2010 $ +.Dd $Mdocdate: October 24 2010 $ .Dt DPB 1 .Os .Sh NAME @@ -23,7 +23,7 @@ .Sh SYNOPSIS .Nm dpb .Bk -words -.Op Fl acersuUx +.Op Fl aceqrsuUx .Op Fl A Ar arch .Op Fl b Ar logfile .Op Fl h Ar hosts @@ -116,6 +116,8 @@ Avoid for now, as mfs has serious race conditions which yield random errors under stress conditions such as bulk build. .It Fl P Ar subdirlist Read list of pkgpaths from file +.It Fl q +Don't quit while errors/locks are around. .It Fl r Random build order. Disregard any kind of smart heuristics.