From a36d4b2831fdb36a0c8ddaec5a023104932df73d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 22 May 2013 16:35:23 +0200 Subject: 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 Signed-off-by: Allan McRae --- scripts/makepkg-template.pl.in | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'scripts') 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"; -- cgit v1.2.3-70-g09d2