common/tools/populateziptemplate.pl
changeset 277 6a23ed4f83b5
parent 261 a0e85954c23c
child 313 52d855dfda13
equal deleted inserted replaced
276:140d2eb79802 277:6a23ed4f83b5
    23 # Raw inputs come in as parameters to the script
    23 # Raw inputs come in as parameters to the script
    24 # TODO: Use a proper option parsing module
    24 # TODO: Use a proper option parsing module
    25 my $sourcesCSV = shift or die "First arg must be source csv file";
    25 my $sourcesCSV = shift or die "First arg must be source csv file";
    26 my $template = shift or die "Second arg must be template file";
    26 my $template = shift or die "Second arg must be template file";
    27 my $ftl = shift or die "Third arg must be output file";
    27 my $ftl = shift or die "Third arg must be output file";
    28 shift and die "No more than three arguments please";
    28 my $rndExcludes = shift or die "Fourth arg must be rnd-excludes file";
       
    29 shift and die "No more than four arguments please";
    29 
    30 
    30 # Load CSV
    31 # Load CSV
    31 open my $csvText, "<", $sourcesCSV or die;
    32 open my $csvText, "<", $sourcesCSV or die;
    32 my $csv = Text::CSV->new();
    33 my $csv = Text::CSV->new();
    33 my @keys;
    34 my @keys;
    89 		};
    90 		};
    90 	}
    91 	}
    91 	elsif ($package->{source} =~ m{/rnd/([^/]+)/([^/]+)})
    92 	elsif ($package->{source} =~ m{/rnd/([^/]+)/([^/]+)})
    92 	{
    93 	{
    93 		# RnD repository
    94 		# RnD repository
    94 		my $name = "bin_rnd_$1_$2";
    95 		my $name = "binaries_$2";
       
    96 		if ($1 eq "rndonly") { $name="bin_$1_$2";}
       
    97 		
    95 		# Create a zip object
    98 		# Create a zip object
    96 		push @{$zipConfig->{config}->{config}->{src}->{config}->{rnd}->{config}},
    99 		push @{$zipConfig->{config}->{config}->{src}->{config}->{rnd}->{config}},
    97 		{
   100 		{
    98 			set =>
   101 			set =>
    99 			[
   102 			[
   139 push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes;
   142 push @{$zipConfig->{config}->{config}->{bin}->{config}->{set}}, @excludes;
   140 
   143 
   141 $xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', KeyAttr => $keyAttr);
   144 $xml->XMLout($zipConfig, OutputFile => $ftl, XMLDecl => 1, RootName => 'build', KeyAttr => $keyAttr);
   142 
   145 
   143 # Output all rnd files into exclude list for later
   146 # Output all rnd files into exclude list for later
   144 open FILE, "> rnd_excludefile.txt" or die "Cannot write exludefile!";
   147 open my $fh, ">", $rndExcludes or die "Cannot write exlude file!";
   145 print FILE @allRndFiles;
   148 print $fh @allRndFiles;
   146 close FILE;
   149 close $fh;