From 202a4e36db3760b43b9261646d2db5ded54a8045 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Tue, 13 Jun 2023 13:13:34 +0200 Subject: [PATCH] Log die message to the end after bsdcons has spamed the log file. --- Logcmd.pm | 12 ++++++++++-- once.pl | 7 +++++-- run.pl | 5 ++++- step.pl | 5 ++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Logcmd.pm b/Logcmd.pm index c1a9ab40..c77167b0 100644 --- a/Logcmd.pm +++ b/Logcmd.pm @@ -23,10 +23,11 @@ use File::Copy; use POSIX; use parent 'Exporter'; -our @EXPORT= qw(createlog logmsg logeval runcmd forkcmd waitcmd logcmd loggrep); +our @EXPORT= qw(createlog relogdie logmsg logeval runcmd forkcmd waitcmd logcmd + loggrep); use subs qw(logmsg); -my ($fh, $file, $verbose); +my ($fh, $file, $verbose, @diemsg); sub createlog { my %args = @_; $file = $args{file}; @@ -39,10 +40,17 @@ sub createlog { $SIG{__DIE__} = sub { print $fh @_ if $fh; + @diemsg = @_; die @_; }; } +sub relogdie { + return unless @diemsg; + print $fh @diemsg if $fh; + print @diemsg if $verbose; +} + sub logmsg { print $fh @_ if $fh; print @_ if $verbose; diff --git a/once.pl b/once.pl index 49fecba1..9c20595b 100755 --- a/once.pl +++ b/once.pl @@ -155,8 +155,11 @@ # do not run end block until initialized, date may change later my $odate = $date; END { - bsdcons_hosts(cvsdate => $cvsdate, patch => $patch, modify => $modify, - release => $release) if $odate; + if ($odate) { + bsdcons_hosts(cvsdate => $cvsdate, patch => $patch, modify => $modify, + release => $release); + relogdie(); + } my @cmd = ("$performdir/bin/setup-html.pl"); system(@cmd) if $performdir; @cmd = ("$performdir/bin/running-html.pl"); diff --git a/run.pl b/run.pl index 7ab6a73f..1db61804 100755 --- a/run.pl +++ b/run.pl @@ -103,7 +103,10 @@ # do not run end block until initialized, date may change later my $odate = $date; END { - bsdcons_hosts() if $odate; + if ($odate) { + bsdcons_hosts(); + relogdie(); + } my @cmd = ("$regressdir/bin/setup-html.pl"); system(@cmd) if $regressdir; @cmd = ("$regressdir/bin/running-html.pl"); diff --git a/step.pl b/step.pl index 8604189c..9e0fa055 100755 --- a/step.pl +++ b/step.pl @@ -172,7 +172,10 @@ # do not run end block until initialized, date may change later my $odate = $date; END { - bsdcons_hosts(release => $release) if $odate; + if ($odate) { + bsdcons_hosts(release => $release); + relogdie(); + } my @cmd = ("$performdir/bin/setup-html.pl"); system(@cmd) if $performdir; @cmd = ("$performdir/bin/running-html.pl");