Skip to content
Snippets Groups Projects
Unverified Commit 5f8c0ac7 authored by boklm's avatar boklm
Browse files

Bug 33993: Check type of target, target_prepend, target_append

Exit with an error message if target, target_prepend or target_append
defined in input_files is not an array.
parent 18b396fb
Branches
No related tags found
No related merge requests found
......@@ -811,19 +811,24 @@ sub input_files {
if ($input_file->{target} || $input_file->{target_append}
|| $input_file->{target_prepend}) {
$input_file = { %$input_file };
if (ref $input_file->{target} eq 'ARRAY') {
foreach my $t (qw/target target_append target_prepend/) {
if ($input_file->{$t} && ref $input_file->{$t} ne 'ARRAY') {
exit_error("$t should be an ARRAY:\n" . pp($input_file));
}
}
if ($input_file->{target}) {
$input_file->{target} = process_template_opt($project,
$input_file->{target}, $options);
} else {
$input_file->{target} = $config->{run}{target};
}
if (ref $input_file->{target_prepend} eq 'ARRAY') {
if ($input_file->{target_prepend}) {
$input_file->{target} = [ @{ process_template_opt($project,
$input_file->{target_prepend},
$options) },
@{$input_file->{target}} ];
}
if (ref $input_file->{target_append} eq 'ARRAY') {
if ($input_file->{target_append}) {
$input_file->{target} = [ @{$input_file->{target}},
@{ process_template_opt($project,
$input_file->{target_append},
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment