suggestions from preed b=371325 comment #20 r=preed

git-svn-id: svn://10.0.0.236/trunk@224801 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rhelmer%mozilla.com
2007-04-20 18:55:24 +00:00
parent 1f82e44d11
commit 064aae3716

View File

@@ -205,16 +205,16 @@ sub Bump {
$skipNextLine = 1;
my $interpLine = $line;
$interpLine =~ s/^#\s+CONFIG:\s+//;
foreach my $variable (grep(/%\w+\-*%/, split(/\s+/, $line))) {
foreach my $variable (grep(/%[\w\-]+%/, split(/\s+/, $line))) {
my $key = $variable;
if (! ($key =~ s/.*%(\w+\-*)%.*/$1/g)) {
if (! ($key =~ s/.*%([\w\-]+)%.*/$1/)) {
die("ASSERT: could not parse $variable");
}
if (! $config->Exists(var => $key)) {
if (! $config->Exists(sysvar => $key)) {
die("ASSERT: no replacement found for $key");
}
my $value = $config->Get(var => $key);
my $value = $config->Get(sysvar => $key);
$interpLine =~ s/\%$key\%/$value/g;
}
print OUTFILE $interpLine;