my %repeats;
my %evals;
my @command_vars;
+my %command_tmp_vars;
#default opts
my %default = (
}
sub set_variable {
- my ($lvalue, $rvalue) = @_;
+ my ($lvalue, $rvalue, $command) = @_;
+ # Command line variables override all others
+ if (defined($command_tmp_vars{$lvalue})) {
+ return;
+ }
if ($rvalue =~ /^\s*$/) {
delete $variable{$lvalue};
} else {
$rvalue = process_variables($rvalue);
$variable{$lvalue} = $rvalue;
}
+
+ if (defined($command)) {
+ $command_tmp_vars{$lvalue} = 1;
+ }
}
sub process_compare {
-D TEST_TYPE[2]=build
Sets TEST_TYPE of test 2 to "build"
+ It can also override all temp variables.
+ -D USE_TEMP_DIR:=1
+ Will override all variables that use
+ "USE_TEMP_DIR="
+
EOF
;
}
die_usage if ($#ARGV < 1);
my $val = shift;
- $command_vars[$#command_vars + 1] = $val;
+ if ($val =~ m/(.*?):=(.*)$/) {
+ set_variable($1, $2, 1);
+ } else {
+ $command_vars[$#command_vars + 1] = $val;
+ }
} elsif ( $ARGV[0] eq "-h" ) {
die_usage;