summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2013-09-07 19:20:30 +0200
committerThorsten Behrens <tbehrens@suse.com>2013-09-08 16:09:57 +0000
commit6f83e4389912967432260ead0db132f373a880bd (patch)
treef53bb5ad854f50806bb43587e3d83dba8e379d6e
parentce9c390e1a100921fd4300d6acb602b4af2b7003 (diff)
break the habit of throwing away the actually useful error messages
The lines that help dignose a problem is almost never the first one that just states "there was an error". The explanation of the error follows in the next lines. So don't quit immediately after the first error-line, but wait what the command has to tell and log/print the whole info. Change-Id: I2a4b3470b4b66ed37fa5e5a34d452c548d24b965 Reviewed-on: https://gerrit.libreoffice.org/5861 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com>
-rw-r--r--postprocess/signing/signing.pl21
1 files changed, 10 insertions, 11 deletions
diff --git a/postprocess/signing/signing.pl b/postprocess/signing/signing.pl
index 686e56afd6d6..fc17092594d5 100644
--- a/postprocess/signing/signing.pl
+++ b/postprocess/signing/signing.pl
@@ -208,17 +208,16 @@ sub execute #11.07.2007 10:02
{
my $commandline = shift;
my $result = "";
-
- print "$commandline\n" if ($debug);
- open(PIPE, "$commandline 2>&1 |") || die "Error: Cant open pipe!\n";
- while ( $result = <PIPE> ) {
- print LOG "$result" if ($opt_log); # logging
- if ( $result =~ /SignTool Error\:/ ) {
- close PIPE;
- print_error( "$result\n" );
- } # if error
- } # while
- close PIPE;
+ my $errorlines = "";
+
+ print "$commandline\n" if ($debug);
+ open(PIPE, "$commandline 2>&1 |") || die "Error: Cannot execute '$commandline' - $!\n";
+ while ( $result = <PIPE> ) {
+ print LOG "$result" if ($opt_log);
+ $errorlines .= $result if ($result =~ /SignTool Error\:/);
+ } # while
+ close PIPE;
+ print_error( "$errorlines\n" ) if ($errorlines);
} ##execute
############################################################################