4 # Call with the following args:
5 # -n <newVariableNameFile> -a <assetInfoFile>
7 my $newVariableFileName;
11 my %targetVariableNames;
13 sub loadTargetVariableNamesFromFile
18 open($fileHandle, "<$filename") or die "failed to open file [$filename]: $!";
23 if ($_ =~ m/\[(.+)\]/)
26 $targetVariableNames{$name} = 1;
27 print STDERR
"target variable [$name]\n" if $debug;
34 sub findVariableNameUsage
39 print "variableName\treferencing assetName\n";
41 open($fileHandle, "<$filename") or die "failed to open file [$filename]: $!";
45 if (($_ =~ m/^I /) || ($_ =~ m/^P /))
50 # read asset name and variable name.
51 m/([^:]+):([^:]+):/ or die "line [$_] does not match customization variable info data format";
53 my $variableName = $2;
55 # if the variable name is one of the targets, print out the asset.
56 if (exists $targetVariableNames{$variableName})
58 print "$variableName\t$assetName\n";
68 my $currentArg = shift @ARGV;
69 if ($currentArg =~ m/-d/)
72 print STDERR
"debugging turned on\n";
74 elsif ($currentArg =~ m/-n/)
76 $newVariableFileName = shift @ARGV;
77 print STDERR
"newVariableFileName=[$newVariableFileName]\n" if $debug;
79 elsif ($currentArg =~ m/-a/)
81 $assetInfoFileName = shift @ARGV;
82 print STDERR
"assetInfoFileName=[$assetInfoFileName]\n" if $debug;
86 # Load in new variable names
87 loadTargetVariableNamesFromFile
($newVariableFileName);
89 # Find asset usage of target names
90 findVariableNameUsage
($assetInfoFileName);