summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/makepkg-template.pl.in22
1 files changed, 8 insertions, 14 deletions
diff --git a/scripts/makepkg-template.pl.in b/scripts/makepkg-template.pl.in
index 6997a835..7e377991 100755
--- a/scripts/makepkg-template.pl.in
+++ b/scripts/makepkg-template.pl.in
@@ -120,21 +120,15 @@ sub process_file {
if ($line =~ $template_marker) {
my $values = parse_template_line($line, $filename, $linenumber);
- given ($values->{command}) {
- when (['start', 'input']) {
- if ($nesting_level == 0) {
- $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";
+ if ($values->{command} eq "start" or $values->{command} eq "input") {
+ if ($nesting_level == 0) {
+ $ret .= load_template($values);
}
+ } 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";