mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-07 13:14:51 +00:00
More configuration tweaks. Rename %CONFIGS to %SETUPS to make the code
clearer (particularly to someone who has read the man page). Don't print anything on stderr.
This commit is contained in:
parent
f7d341e06d
commit
9878532be8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115070
@ -34,7 +34,7 @@ use strict;
|
|||||||
use POSIX qw(tzset);
|
use POSIX qw(tzset);
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
|
|
||||||
my %CONFIGS = (
|
my %SETUPS = (
|
||||||
# Global settings
|
# Global settings
|
||||||
'global' => {
|
'global' => {
|
||||||
'SANDBOX' => '/home/des/tinderbox',
|
'SANDBOX' => '/home/des/tinderbox',
|
||||||
@ -43,7 +43,6 @@ my %CONFIGS = (
|
|||||||
'SENDER' => 'Tinderbox <des+tinderbox@freebsd.org>',
|
'SENDER' => 'Tinderbox <des+tinderbox@freebsd.org>',
|
||||||
'RECIPIENT' => 'des+%%arch%%-%%branch%%@freebsd.org',
|
'RECIPIENT' => 'des+%%arch%%-%%branch%%@freebsd.org',
|
||||||
'SUBJECT' => '[%%COMMENT%%] failure on %%arch%%/%%machine%%',
|
'SUBJECT' => '[%%COMMENT%%] failure on %%arch%%/%%machine%%',
|
||||||
|
|
||||||
'ENV' => { },
|
'ENV' => { },
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -95,12 +94,14 @@ my %CONFIGS = (
|
|||||||
'ARCHES' => {
|
'ARCHES' => {
|
||||||
'i386' => [ 'i386' ],
|
'i386' => [ 'i386' ],
|
||||||
},
|
},
|
||||||
'ENV' => {
|
},
|
||||||
'NOLIBC_R' => 'YES',
|
|
||||||
'NOPROFILE' => 'YES',
|
'dsa' => {
|
||||||
'NO_BIND' => 'YES',
|
'COMMENT' => "Tinderbox development",
|
||||||
'NO_FORTRAN' => 'YES',
|
'BRANCHES' => [ 'CURRENT' ],
|
||||||
'NO_SENDMAIL' => 'YES',
|
'TARGETS' => [ 'update', 'world', 'lint', 'release' ],
|
||||||
|
'ARCHES' => {
|
||||||
|
'alpha' => [ 'alpha' ],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -111,14 +112,6 @@ my %CONFIGS = (
|
|||||||
'ARCHES' => {
|
'ARCHES' => {
|
||||||
'i386' => [ 'i386' ],
|
'i386' => [ 'i386' ],
|
||||||
},
|
},
|
||||||
'ENV' => {
|
|
||||||
'NOCRYPT' => 'YES',
|
|
||||||
'NOLIBC_R' => 'YES',
|
|
||||||
'NOPROFILE' => 'YES',
|
|
||||||
'NO_BIND' => 'YES',
|
|
||||||
'NO_FORTRAN' => 'YES',
|
|
||||||
'NO_SENDMAIL' => 'YES',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
my $config; # Name of current config
|
my $config; # Name of current config
|
||||||
@ -139,7 +132,6 @@ sub report($$$$) {
|
|||||||
print(PIPE "Subject: $subject\n");
|
print(PIPE "Subject: $subject\n");
|
||||||
print(PIPE "\n");
|
print(PIPE "\n");
|
||||||
print(PIPE "$message\n");
|
print(PIPE "$message\n");
|
||||||
print(STDERR "mailed report to $recipient\n");
|
|
||||||
close(PIPE);
|
close(PIPE);
|
||||||
} else {
|
} else {
|
||||||
print(STDERR "[failed to send report by email]\n\n");
|
print(STDERR "[failed to send report by email]\n\n");
|
||||||
@ -258,23 +250,26 @@ sub tinderbox($$$) {
|
|||||||
$summary .= join('', @lines);
|
$summary .= join('', @lines);
|
||||||
print(BRIEF join('', @lines));
|
print(BRIEF join('', @lines));
|
||||||
}
|
}
|
||||||
close(BRIEF);
|
|
||||||
close(FULL);
|
|
||||||
|
|
||||||
# Done...
|
# Done...
|
||||||
if (waitpid($pid, 0) == -1) {
|
if (waitpid($pid, 0) == -1) {
|
||||||
warn("waitpid(): $!\n");
|
warn("waitpid(): $!\n");
|
||||||
} elsif ($? & 0xff) {
|
} elsif ($? & 0xff) {
|
||||||
warn("tinderbox caught signal ", $? & 0x7f, "\n");
|
my $msg = "tinderbox caught signal " . ($? & 0x7f) . "\n";
|
||||||
|
print(BRIEF $msg);
|
||||||
|
print(FULL $msg);
|
||||||
$error = 1;
|
$error = 1;
|
||||||
} elsif ($? >> 8) {
|
} elsif ($? >> 8) {
|
||||||
warn("tinderbox returned exit code ", $? >> 8, "\n");
|
my $msg = "tinderbox returned exit code " . ($? >> 8) . "\n";
|
||||||
|
print(BRIEF $msg);
|
||||||
|
print(FULL $msg);
|
||||||
$error = 1;
|
$error = 1;
|
||||||
}
|
}
|
||||||
|
close(BRIEF);
|
||||||
|
close(FULL);
|
||||||
|
|
||||||
# Mail out error reports
|
# Mail out error reports
|
||||||
if ($error) {
|
if ($error) {
|
||||||
warn("$branch tinderbox failed for $arch/$machine\n");
|
|
||||||
my $sender = expand($CONFIG{'SENDER'});
|
my $sender = expand($CONFIG{'SENDER'});
|
||||||
my $recipient = expand($CONFIG{'RECIPIENT'});
|
my $recipient = expand($CONFIG{'RECIPIENT'});
|
||||||
my $subject = expand($CONFIG{'SUBJECT'});
|
my $subject = expand($CONFIG{'SUBJECT'});
|
||||||
@ -288,7 +283,7 @@ sub tinderbox($$$) {
|
|||||||
sub usage() {
|
sub usage() {
|
||||||
|
|
||||||
my @configs = ();
|
my @configs = ();
|
||||||
foreach my $config (sort(keys(%CONFIGS))) {
|
foreach my $config (sort(keys(%SETUPS))) {
|
||||||
push(@configs, $config)
|
push(@configs, $config)
|
||||||
unless ($config eq 'global');
|
unless ($config eq 'global');
|
||||||
}
|
}
|
||||||
@ -304,10 +299,10 @@ MAIN:{
|
|||||||
$config =~ s/\..*//;
|
$config =~ s/\..*//;
|
||||||
}
|
}
|
||||||
usage()
|
usage()
|
||||||
unless (exists($CONFIGS{$config}) && $config ne 'global');
|
unless (exists($SETUPS{$config}) && $config ne 'global');
|
||||||
%CONFIG = %{$CONFIGS{$config}};
|
%CONFIG = %{$SETUPS{$config}};
|
||||||
foreach my $key (keys(%{$CONFIGS{'global'}})) {
|
foreach my $key (keys(%{$SETUPS{'global'}})) {
|
||||||
$CONFIG{$key} = $CONFIGS{'global'}->{$key}
|
$CONFIG{$key} = $SETUPS{'global'}->{$key}
|
||||||
unless (exists($CONFIG{$key}));
|
unless (exists($CONFIG{$key}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user