From: Steve Hay Date: Fri, 10 Aug 2012 16:54:51 +0000 (+0100) Subject: Fix command-line argument quoting in Porting/cmpVERSION.pl X-Git-Tag: upstream/5.20.0~5826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ba8970dd3a78097012503f0c4b1900e36b571a9;p=platform%2Fupstream%2Fperl.git Fix command-line argument quoting in Porting/cmpVERSION.pl Windows, NetWare and VMS want double-quotes, other OSes want single quotes. --- diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl index 8d39d74..97c78b2 100755 --- a/Porting/cmpVERSION.pl +++ b/Porting/cmpVERSION.pl @@ -146,6 +146,7 @@ printf "1..%d\n" => scalar keys %module_diffs if $tap; my $count; my $diff_cmd = "git --no-pager diff $tag_to_compare "; +my $q = ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') ? '"' : "'"; my (@diff); foreach my $pm_file (sort keys %module_diffs) { @@ -166,7 +167,7 @@ foreach my $pm_file (sort keys %module_diffs) { } else { if ($tap) { foreach (sort @{$module_diffs{$pm_file}}) { - print "# $_" for `$diff_cmd '$_'`; + print "# $_" for `$diff_cmd $q$_$q`; } if (exists $skip_versions{$pm_file} and grep $pm_version eq $_, @{$skip_versions{$pm_file}}) { @@ -190,6 +191,6 @@ sub get_file_from_git { if ($diffs) { for (sort @diff) { print "\n"; - system "$diff_cmd '$_'"; + system "$diff_cmd $q$_$q"; } }