From 9894009117bc896f9864b5768ac1f01a4d3d24db Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Mon, 9 Apr 2012 14:10:20 -0500 Subject: Support the --continue option, ignoring build failures Change-Id: I409f6b157cbe9de7c173ac1b8458b06548051db9 Reviewed-by: Rohan McGovern --- build | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/build b/build index 1b718b11..520f9e9f 100755 --- a/build +++ b/build @@ -136,7 +136,7 @@ sub parse_arguments GetOptionsFromArray(\@args, 'verbose|v:1' => \$self->{'verbose'}, - 'continue' => \$self->{'continue'}, + 'continue|c:1' => \$self->{'continue'}, 'jobs|j:0' => \$self->{'jobs'}, 'force-qmake' => \$self->{'force_qmake'}, 'dry-run|n:1' => \$self->{'dry-run'}, @@ -269,16 +269,19 @@ sub detect_configuration $self->{'MAKEOPTS'} = ""; } - if ($exe =~ 'nmake|jom' && $self->{'dry-run'} > 1) { - $self->{'MAKEOPTS'} = "/N $self->{'MAKEOPTS'}"; + if ($exe =~ 'nmake|jom') { + $self->{'MAKEOPTS'} = "/N $self->{'MAKEOPTS'}" if ($self->{'dry-run'} > 1); + $self->{'MAKEOPTS'} = "/K $self->{'MAKEOPTS'}" if ($self->{'continue'} > 1); } } # Tools needed for building QtWebKit/Windows (Bison, Flex, gperf, iconv) my $abs_path = abs_path('gnuwin32/bin'); unshift @PATH, "$abs_path"; - } else { + } + if ($self->{'MAKE'} !~ "nmake|jom") { $self->{'MAKEOPTS'} = "--dry-run $self->{'MAKEOPTS'}" if ($self->{'dry-run'} > 1); + $self->{'MAKEOPTS'} = "--keep-going $self->{'MAKEOPTS'}" if ($self->{'continue'} > 1); } } @@ -431,11 +434,27 @@ sub build_project } $build_command = "$self->{MAKE} $self->{MAKEOPTS}"; } - $self->exeLowPriv("cd $module && $build_command"); + eval { $self->exeLowPriv("cd $module && $build_command"); }; + if ($@) { + print STDERR "'cd $module && $build_command' failed: $?\n"; + if ($self->{'continue'}) { + print STDERR "Ignoring failure building $module (--continue)\n"; + } else { + confess "Fatal failure building $module"; + } + } $install_command = "$self->{MAKE} install" if (!defined $install_command); ### TODO: Should be fixed after the alpha unless ("$Config{osname}" =~ /(dar|ms)win/i) { - $self->exeHighPriv("cd $module && $install_command"); + eval { $self->exeHighPriv("cd $module && $install_command"); }; + if ($@) { + print STDERR "'cd $module && $install_command failed: $?\n"; + if ($self->{'continue'}) { + print STDERR "Ignoring failure installing $module (--continue)\n"; + } else { + confess "Fatal failure installing $module"; + } + } } $self->mark_as_finished($module); return 0; -- cgit v1.2.3