[SCM] Debian package checker branch, master, updated. 2.5.4-129-gfd0ab45
The following commit has been merged in the master branch:
commit fd0ab459c01521fe24431fa04679c3f1b659e432
Author: Niels Thykier <niels@thykier.net>
Date: Wed Feb 1 12:34:09 2012 +0100
Fix broken Log in dry-run and some uses of Die
In dry-run mode it now opens the LOG descriptor used by the Log
function. As Die (not to be confused with die) uses Log to output an
error, it should not be used before the log file has been opened.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/reporting/harness b/reporting/harness
index c365fd5..95d96f2 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -109,15 +109,17 @@ $| = 1;
unless ($opt{'dry-run'}) {
# rotate log files
system("savelog $log_file $changes_file $list_file $html_reports_log >/dev/null") == 0
- or Die('cannot rotate log files');
+ or die "Cannot rotate log files.\n";
# create new log file
open(LOG, '>', $log_file)
- or Die("cannot open log file $log_file for writing: $!");
+ or die "cannot open log file $log_file for writing: $!";
} else {
- $log_file = \*STDOUT{IO};
+ open LOG, '>&', \*STDOUT
+ or die "Cannot open log file <stdout> for writing: $!";
Log('Running in dry-run mode');
}
+# From here on we can use Log() and Die().
unless ($opt{'dry-run'}) {
system("mkdir -p -m 775 $LINTIAN_BIN_DIR") == 0 || die "$!";
--
Debian package checker
Reply to: