# HG changeset patch # User Simon Howkins # Date 1251194783 -3600 # Node ID d4dac57985d974335e9d2ec286724c8a243008af # Parent 1d777b8357dfa0093fdd14a173a0920a341ab803 Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component Changed so that even if it encounters an error it will still generate the output file before it exits with a failure error code. diff -r 1d777b8357df -r d4dac57985d9 common/tools/populateziptemplate.pl --- a/common/tools/populateziptemplate.pl Mon Aug 24 17:51:03 2009 +0100 +++ b/common/tools/populateziptemplate.pl Tue Aug 25 11:06:23 2009 +0100 @@ -33,7 +33,7 @@ } # Load CSV -open my $csvText, "<", $sourcesCSV or die; +open my $csvText, "<", $sourcesCSV or die "Unable to open sources.csv from $sourcesCSV"; my $csv = Text::CSV->new(); my @keys; my @packages; @@ -71,6 +71,8 @@ my $zipConfig = $xml->XMLin($template, keyattr => $keyAttr); my @allRndFiles; +my $failures = 0; + # For each package in CSV... foreach my $package (@packages) { @@ -140,7 +142,8 @@ } else { - die "Cannot determine license for '$package->{source}'"; + warn "Cannot determine license for '$package->{source}'\n"; + $failures++; } } @@ -154,3 +157,5 @@ open my $fh, ">", $rndExcludes or die "Cannot write exlude file!"; print $fh @allRndFiles; close $fh; + +exit($failures);