Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component
Source that cannot be sorted correctly into any other category is treated as "misc"
--- a/common/templates/zip.cfg.xml.ftl.template Thu Jul 23 17:59:02 2009 +0100
+++ b/common/templates/zip.cfg.xml.ftl.template Wed Sep 02 11:43:32 2009 +0100
@@ -37,6 +37,9 @@
<config name="rnd" abstract="true">
<set name="grace.filters" value="rnd" />
</config>
+ <config name="misc" abstract="true">
+ <set name="grace.filters" value="misc" />
+ </config>
</config>
<config name="src-by-layer" abstract="true">
<set name="grace.metadata" value="false" />
--- a/common/tools/populateziptemplate.pl Thu Jul 23 17:59:02 2009 +0100
+++ b/common/tools/populateziptemplate.pl Wed Sep 02 11:43:32 2009 +0100
@@ -70,8 +70,7 @@
my $xml = XML::Simple->new();
my $zipConfig = $xml->XMLin($template, keyattr => $keyAttr);
my @allRndFiles;
-
-my $failures = 0;
+my $miscCount = 0;
# For each package in CSV...
foreach my $package (@packages)
@@ -142,8 +141,23 @@
}
else
{
- warn "Cannot determine license for '$package->{source}'\n";
- $failures++;
+ (my $dest2 = $package->{dst}) =~ s{[\\/]}{_slash_}g;
+ push @{$zipConfig->{config}->{config}->{src}->{config}->{misc}->{config}},
+ {
+ set =>
+ [
+ {
+ name => "name",
+ value=> "src_misc_$dest2"."_$miscCount",
+ },
+ {
+ name => "include",
+ value => "$package->{dst}/**",
+ },
+ ]
+ };
+ $miscCount++;
+ warn "Warning: Cannot determine license for '$package->{source}' - it will be packaged as 'src_misc_$dest2"."_$miscCount'\n";
}
}
@@ -158,4 +172,3 @@
print $fh @allRndFiles;
close $fh;
-exit($failures);