makepkg-template: Stop using given/when
given/when has been marked experimental in perl 5.18 because it will change it 5.20. if/else is ugly, but hiding the generated warning is no good solution either, so we us if/else for now. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
cbc25c22fc
commit
a36d4b2831
1 changed files with 8 additions and 14 deletions
|
@ -120,21 +120,15 @@ sub process_file {
|
||||||
if ($line =~ $template_marker) {
|
if ($line =~ $template_marker) {
|
||||||
my $values = parse_template_line($line, $filename, $linenumber);
|
my $values = parse_template_line($line, $filename, $linenumber);
|
||||||
|
|
||||||
given ($values->{command}) {
|
if ($values->{command} eq "start" or $values->{command} eq "input") {
|
||||||
when (['start', 'input']) {
|
if ($nesting_level == 0) {
|
||||||
if ($nesting_level == 0) {
|
$ret .= load_template($values);
|
||||||
$ret .= load_template($values);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
when ('end') {
|
|
||||||
# nothing to do here, just for completeness
|
|
||||||
}
|
|
||||||
|
|
||||||
default {
|
|
||||||
die sprintf(gettext("Unknown template marker '%s'\n"), $values->{command}),
|
|
||||||
"$filename:$linenumber: $line";
|
|
||||||
}
|
}
|
||||||
|
} elsif ($values->{command} eq "end") {
|
||||||
|
# nothing to do here, just for completeness
|
||||||
|
} else {
|
||||||
|
die sprintf(gettext("Unknown template marker '%s'\n"), $values->{command}),
|
||||||
|
"$filename:$linenumber: $line";
|
||||||
}
|
}
|
||||||
|
|
||||||
$nesting_level++ if $values->{command} eq "start";
|
$nesting_level++ if $values->{command} eq "start";
|
||||||
|
|
Loading…
Add table
Reference in a new issue