Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
authorSimon Howkins <simonh@symbian.org>
Tue, 25 Aug 2009 11:06:23 +0100
changeset 380 d4dac57985d9
parent 379 1d777b8357df
child 381 ad45f298ad85
child 412 e7e26750f383
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.
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);