[sheepdog] [PATCH] script: fix gen_bash_completion errors with the old perl version

MORITA Kazutaka morita.kazutaka at gmail.com
Fri Aug 16 21:56:55 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

The current script causes errors on debian squeeze.  This fixes it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 script/gen_bash_completion.pl |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/script/gen_bash_completion.pl b/script/gen_bash_completion.pl
index 070130c..cbfad3e 100755
--- a/script/gen_bash_completion.pl
+++ b/script/gen_bash_completion.pl
@@ -32,7 +32,7 @@ foreach (@help) {
 
 	$subcmds{$cmd} = []  if (!defined($subcmds{$cmd}));
 
-	push $subcmds{$cmd}, $subcmd;
+	push @{$subcmds{$cmd}}, $subcmd;
 	$opts{"$cmd $subcmd"} = [];
 	$subsubcmds{"$cmd $subcmd"} = [];
 
@@ -41,11 +41,11 @@ foreach (@help) {
 	while (<IN>) {
 	    if (/^  (-.), (--\S+)/) {
 		# get options
-		push $opts{"$cmd $subcmd"}, $1;
-		push $opts{"$cmd $subcmd"}, $2;
+		push @{$opts{"$cmd $subcmd"}}, $1;
+		push @{$opts{"$cmd $subcmd"}}, $2;
 	    } elsif (/^  ([a-z]+)/) {
 		# get available subcommands
-		push $subsubcmds{"$cmd $subcmd"}, $1;
+		push @{$subsubcmds{"$cmd $subcmd"}}, $1;
 	    }
 	}
 	close IN;
-- 
1.7.9.5




More information about the sheepdog mailing list