summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-06-04 15:09:53 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-06-04 15:09:53 +0200
commitb23b72e19986d2c6fc75a2413690ae788f2d4880 (patch)
tree7dee406e88edcc56f7c3ce76c394e7bc0e16d334
parentd92479ae306a2c6bdd7293028a5a229122748537 (diff)
parent246004a37365ad654f719ce3343483255464ee81 (diff)
CWS-TOOLING: integrate CWS rt38
Notes
Notes: split repo tag: postprocess_ooo/DEV300_m81 split repo tag: postprocess_ooo/DEV300_m82
-rw-r--r--postprocess/checkdeliver/checkdeliver.pl67
-rw-r--r--postprocess/checkdeliver/makefile.mk3
2 files changed, 39 insertions, 31 deletions
diff --git a/postprocess/checkdeliver/checkdeliver.pl b/postprocess/checkdeliver/checkdeliver.pl
index afd52ae0fec5..46a9ad9238f4 100644
--- a/postprocess/checkdeliver/checkdeliver.pl
+++ b/postprocess/checkdeliver/checkdeliver.pl
@@ -46,25 +46,27 @@ my $err = 0;
my $srcrootdir = '';
my $solverdir = '';
my $platform = '';
+my $logfile = '';
my $milestoneext = '';
my $local_env = 0;
my $source_config = SourceConfig -> new($ENV{SOLARSRC});
my @exceptionmodlist = (
"postprocess",
"instset.*native",
- "smoketest.*native"
+ "smoketest.*native",
+ "testgraphical"
); # modules not yet delivered
#### main #####
-print "checkdeliver.pl - checking delivered binaries\n";
+print_logged("checkdeliver.pl - checking delivered binaries\n");
get_globals(); # get global variables
my $deliverlists_ref = get_deliver_lists(); # get deliver log files
foreach my $listfile ( @$deliverlists_ref ) {
$err += check( $listfile ); # check delivered files
}
-print "OK\n" if ( ! $err );
+print_logged("OK\n") if ( ! $err );
exit $err;
#### subroutines ####
@@ -82,6 +84,7 @@ sub get_globals
# override environment with command line options
GetOptions('help' => \$help,
+ 'l=s' => \$logfile,
'p=s' => \$platform
) or usage (1);
@@ -127,7 +130,8 @@ sub get_deliver_lists
@files = grep ! /\/$exceptionpattern\//, @files;
}
if ( ! @files ) {
- die "Error: cannot find deliver log files";
+ print_logged( "Error: cannot find deliver log files\n" );
+ exit 1;
}
return \@files;
}
@@ -144,7 +148,7 @@ sub check
if ( $listname =~ /\/([\w-]+?)\/deliver\.log$/o) {
$module = $1;
} else {
- print "Error: cannot determine module name from \'$listname\'\n";
+ print_logged( "Error: cannot determine module name from \'$listname\'\n" );
return 1;
}
# where do we have to look for modules?
@@ -158,12 +162,11 @@ sub check
# do not bother about non existing modules in local environment
# or on childworkspaces
if (( $local_env ) || ( $ENV{CWS_WORK_STAMP} )) {
- # print STDERR "Warning: module '$module' not found. Skipping.\n";
return $error;
}
# in a master build it is considered an error to have deliver leftovers
# from non exising (removed) modules
- print "Error: module '$module' not found.\n";
+ print_logged( "Error: module '$module' not found.\n" );
$error++;
return $error;
}
@@ -174,7 +177,10 @@ sub check
}
# read deliver log file
- open( DELIVERLOG, "< $listname" ) or die( "Error: cannot open file \'$listname\'\n$!");
+ if ( ! open( DELIVERLOG, "< $listname" ) ) {
+ print_logged( "Error: cannot open file \'$listname\'\n$!" );
+ exit 2;
+ }
foreach ( <DELIVERLOG> ) {
next if ( /^LINK / );
# For now we concentrate on binaries, located in 'bin' or 'lib' and 'misc/build/<...>/[bin|lib]'.
@@ -185,7 +191,7 @@ sub check
if ( /^\w+? (\S+) (\S+)\s*$/o ) {
$delivered{$1} = $2;
} else {
- print "Warning: cannot parse \'$listname\' line\n\'$_\'\n";
+ print_logged( "Warning: cannot parse \'$listname\' line\n\'$_\'\n" );
}
}
close( DELIVERLOG );
@@ -216,38 +222,24 @@ sub check
# rebasing, but only increase. It must not happen that a file on
# solver is older than it's source.
if ( ( $orgfile_stats->mtime - $delivered_stats->mtime ) gt 1 ) {
- print "Error: ";
- print "delivered file is older than it's source '$ofile' '$sfile'\n";
+ print_logged( "Error: " );
+ print_logged( "delivered file is older than it's source '$ofile' '$sfile'\n" );
$error ++;
}
} elsif ( !$orgfile_stats && $delivered_stats ) {
# This is not an error if we have a solver and did not build the
# module!
} elsif ( !$orgfile_stats && !$delivered_stats ) {
- # This is not an error if we have a solver and did not build the
- # module!
- # Instead, this seems to be an error of the deliver.log file, where
- # even in the master build an allegedly delivered directory is not
- # present in the solver. Places where this occurred:
- #
- # moz_prebuilt/deliver.log:
- # COPY macromigration/unxlngi6/bin/samples unxlngi6/bin/samples
- # COPY macromigration/unxlngi6/bin/lib unxlngi6/bin/lib
- #
- # macromigration/deliver.log:
- # COPY moz_prebuilt/unxlngi6/lib/defaults unxlngi6/lib/defaults
- # COPY moz_prebuilt/unxlngi6/lib/greprefs unxlngi6/lib/greprefs
- # COPY moz_prebuilt/unxlngi6/lib/components unxlngi6/lib/components
- #
- # However release engineers got around that..
+ # This is not necessarily an error.
+ # Instead, this seems to be an error of the deliver.log file.
} else {
- print "Error: no such file '$ofile'\n" if ( ! $orgfile_stats );
- print "Error: no such file '$sfile'\n" if ( ! $delivered_stats );
+ print_logged( "Error: no such file '$ofile'\n" ) if ( ! $orgfile_stats );
+ print_logged( "Error: no such file '$sfile'\n" ) if ( ! $delivered_stats );
$error ++;
}
}
if ( $error ) {
- print "$error errors found: Module '$module' not delivered correctly?\n\n";
+ print_logged( "$error errors found: Module '$module' not delivered correctly?\n\n" );
}
STDOUT->autoflush(0);
return $error;
@@ -269,6 +261,21 @@ sub is_moduledirectory
}
}
+sub print_logged
+# Print routine.
+# If a log file name is specified with '-l' option, print_logged() prints to that file
+# as well as to STDOUT. If '-l' option is not set, print_logged() just writes to STDOUT
+{
+ my $message = shift;
+ print "$message";
+ if ( $logfile ) {
+ open ( LOGFILE, ">> $logfile" ) or die "Can't open logfile '$logfile'\n";
+ print LOGFILE "$message";
+ close ( LOGFILE) ;
+ }
+}
+
+
sub usage
# print usage message and exit
{
diff --git a/postprocess/checkdeliver/makefile.mk b/postprocess/checkdeliver/makefile.mk
index 7f5665e7585b..dfbd5c317de1 100644
--- a/postprocess/checkdeliver/makefile.mk
+++ b/postprocess/checkdeliver/makefile.mk
@@ -38,5 +38,6 @@ TARGET=checkdeliver
ALLTAR : $(MISC)$/checkdeliver.done
$(MISC)$/checkdeliver.done .PHONY:
- $(PERL) checkdeliver.pl && $(TOUCH) $@
+ @-$(RM) $(MISC)$/checkdeliver_log.txt
+ $(PERL) checkdeliver.pl -l $(MISC)$/checkdeliver_log.txt && $(TOUCH) $@