mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
ktest: Evaluate options before processing them
All options can take variables "${var}". Before doing any processing or decision making on the content of an option, evaluate it incase there are variables that may change the outcome. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
2b29b2f8f8
commit
cad9666980
@ -416,10 +416,12 @@ sub process_variables {
|
|||||||
sub set_value {
|
sub set_value {
|
||||||
my ($lvalue, $rvalue, $override, $overrides, $name) = @_;
|
my ($lvalue, $rvalue, $override, $overrides, $name) = @_;
|
||||||
|
|
||||||
if ($buildonly && $lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $rvalue ne "build") {
|
my $prvalue = process_variables($rvalue);
|
||||||
|
|
||||||
|
if ($buildonly && $lvalue =~ /^TEST_TYPE(\[.*\])?$/ && $prvalue ne "build") {
|
||||||
# Note if a test is something other than build, then we
|
# Note if a test is something other than build, then we
|
||||||
# will need other manditory options.
|
# will need other manditory options.
|
||||||
if ($rvalue ne "install") {
|
if ($prvalue ne "install") {
|
||||||
$buildonly = 0;
|
$buildonly = 0;
|
||||||
} else {
|
} else {
|
||||||
# install still limits some manditory options.
|
# install still limits some manditory options.
|
||||||
@ -435,13 +437,12 @@ sub set_value {
|
|||||||
}
|
}
|
||||||
die "$name: $.: Option $lvalue defined more than once!\n$extra";
|
die "$name: $.: Option $lvalue defined more than once!\n$extra";
|
||||||
}
|
}
|
||||||
${$overrides}{$lvalue} = $rvalue;
|
${$overrides}{$lvalue} = $prvalue;
|
||||||
}
|
}
|
||||||
if ($rvalue =~ /^\s*$/) {
|
if ($rvalue =~ /^\s*$/) {
|
||||||
delete $opt{$lvalue};
|
delete $opt{$lvalue};
|
||||||
} else {
|
} else {
|
||||||
$rvalue = process_variables($rvalue);
|
$opt{$lvalue} = $prvalue;
|
||||||
$opt{$lvalue} = $rvalue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user