# HG changeset patch # User Louis Henry Nayegon # Date 1243606577 -3600 # Node ID 6c171c40e0123c3024a926225ef52f93bd7a6fe4 # Parent 5b2818c52aae32547d228f415b30c3479d479975# Parent 5639fead6fba1a51e7cb026f88a0f9f182ab8635 merge - catch up diff -r 5b2818c52aae -r 6c171c40e012 common/tools/analysis/merge_csv.pl --- a/common/tools/analysis/merge_csv.pl Fri May 29 15:13:32 2009 +0100 +++ b/common/tools/analysis/merge_csv.pl Fri May 29 15:16:17 2009 +0100 @@ -17,7 +17,7 @@ use strict; my $csvfile = shift @ARGV; my $filelist = shift @ARGV; - +my $zipfile = shift @ARGV; if(! -e $csvfile) { @@ -29,7 +29,28 @@ { die "Cannot find $filelist\n"; } + my %ziptimes; + if(defined $zipfile) + { + open(ZIP,"7z l $zipfile 2>&1|") or die "Error: Couldn't look in $zipfile\n"; +# print "time,file\n"; + while( my $line = ) + { + if($line =~ m/^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s\S{5}\s+(\d+)\s+\d+\s+(.+)$/) #ignoring packed size... + { + my $name = $3; + my $size = $2; + my $time = $1; + $name =~ s/\\/\//g; + $name = lc($name); + $ziptimes{$name} = $time; +# print "$time,$name\n"; + } + } + close ZIP; + } my %files; + open(FILES,"<$filelist") or die "Couldn't open $filelist\n"; while(my $line = ) { @@ -44,7 +65,7 @@ if($files{$file}) { - $files{$file} = $files{$file}.",".$group; + $files{$file} = $files{$file}." ".$group; #Stop polluting next column print "Multi:$file".$files{$file}."\n"; } @@ -61,7 +82,7 @@ open(RESULTS,">$resultsfile") or die "Couldn't open write to $resultsfile\n"; my $header = ; $header =~ s/\n//; - print RESULTS $header.",status\n"; + print RESULTS $header.",status,time\n"; my @fields = split(',',$header); my $targetindex = 0; my $counter = 0; @@ -93,9 +114,10 @@ { $bldinffiles{$bldinf} = 1; } - + my $found = 0; if(defined $files{$target}) - { + { + $found = 1; $line = $line.$files{$target}; if($files{$target} =~ m/fail/i) { @@ -105,6 +127,17 @@ } } } + if(defined $ziptimes{$target}) + { + if($found) + { + $line = $line.",".$ziptimes{$target}; + } + else + { + $line = $line.",,".$ziptimes{$target}; + } + } print RESULTS $line."\n"; }