common/tools/populateziptemplate.pl
changeset 372 ea854a4b723d
parent 313 52d855dfda13
child 380 d4dac57985d9
equal deleted inserted replaced
371:fcb6057a8009 372:ea854a4b723d
    66 # This controls how the XML parsing decides what should be tags and what should be attributes
    66 # This controls how the XML parsing decides what should be tags and what should be attributes
    67 # It's been worked out mostly by trial and error :-(
    67 # It's been worked out mostly by trial and error :-(
    68 my $keyAttr = { config => "name", name => "set"};
    68 my $keyAttr = { config => "name", name => "set"};
    69 # Load template
    69 # Load template
    70 my $xml = XML::Simple->new();
    70 my $xml = XML::Simple->new();
    71 my $zipConfig = $xml->XMLin($template, KeyAttr => $keyAttr);
    71 my $zipConfig = $xml->XMLin($template, keyattr => $keyAttr);
    72 my @allRndFiles;
    72 my @allRndFiles;
    73 
    73 
    74 # For each package in CSV...
    74 # For each package in CSV...
    75 foreach my $package (@packages)
    75 foreach my $package (@packages)
    76 {
    76 {
   146 
   146 
   147 # Turn the RnD source inclusion lists into a binary exclusion list
   147 # Turn the RnD source inclusion lists into a binary exclusion list
   148 my @excludes = map { {name => "exclude", value => "$_"} } @allRndFiles;
   148 my @excludes = map { {name => "exclude", value => "$_"} } @allRndFiles;
   149 push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes;
   149 push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes;
   150 
   150 
   151 $xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', KeyAttr => $keyAttr);
   151 $xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', keyattr => $keyAttr);
   152 
   152 
   153 # Output all rnd files into exclude list for later
   153 # Output all rnd files into exclude list for later
   154 open my $fh, ">", $rndExcludes or die "Cannot write exlude file!";
   154 open my $fh, ">", $rndExcludes or die "Cannot write exlude file!";
   155 print $fh @allRndFiles;
   155 print $fh @allRndFiles;
   156 close $fh;
   156 close $fh;