Author: adam-guest
Date: 2008-06-23 18:15:16 +0000 (Mon, 23 Jun 2008)
New Revision: 1521
Modified:
trunk/debian/changelog
trunk/scripts/checkbashisms.1
trunk/scripts/checkbashisms.pl
Log:
Add a --posix option which flags constructs not supported by POSIX but
permitted by Debian Policy (test / [ using -a or -o support is currently
missing pending a reliable check being written)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-06-22 23:14:51 UTC (rev 1520)
+++ trunk/debian/changelog 2008-06-23 18:15:16 UTC (rev 1521)
@@ -9,6 +9,9 @@
+ Apply a small fix to part of the "quoted block detection"
+ Quote test expressions using qr to allow perl to optionally compile
or otherwise optimise them. Thanks to Frank Lichtenheld for the idea.
+ + Add a --posix option which flags constructs not supported by POSIX but
+ permitted by Debian Policy (test / [ using -a or -o support is currently
+ missing pending a reliable check being written)
* Debbugs.pm: Move initialisation of the SOAP object in to a common routine
and set the underlying transport object to honour proxies from the
environment (Closes: #487592)
Modified: trunk/scripts/checkbashisms.1
===================================================================
--- trunk/scripts/checkbashisms.1 2008-06-22 23:14:51 UTC (rev 1520)
+++ trunk/scripts/checkbashisms.1 2008-06-23 18:15:16 UTC (rev 1521)
@@ -28,6 +28,10 @@
.BR \-\-newline ", " \-n
Check for "echo \-n" usage (non POSIX but required by Debian Policy 10.4.)
.TP
+.BR \-\-posix ", " \-p
+Check for issues which are non POSIX but required to be supported by Debian
+Policy 10.4 (implies \-n).
+.TP
.BR \-\-force ", " \-f
Force each script to be checked, even if it would normally not be (for
instance, it has a bash or non POSIX shell shebang or appears to be a
Modified: trunk/scripts/checkbashisms.pl
===================================================================
--- trunk/scripts/checkbashisms.pl 2008-06-22 23:14:51 UTC (rev 1520)
+++ trunk/scripts/checkbashisms.pl 2008-06-23 18:15:16 UTC (rev 1521)
@@ -48,7 +48,7 @@
GNU General Public License, version 2, or (at your option) any later version.
EOF
-my ($opt_echo, $opt_force, $opt_extra);
+my ($opt_echo, $opt_force, $opt_extra, $opt_posix);
my ($opt_help, $opt_version);
##
@@ -61,12 +61,15 @@
"newline|n" => \$opt_echo,
"force|f" => \$opt_force,
"extra|x" => \$opt_extra,
+ "posix|p" => \$opt_posix,
)
or die "Usage: $progname [options] filelist\nRun $progname --help for more
details\n";
if ($opt_help) { print $usage; exit 0; }
if ($opt_version) { print $version; exit 0; }
+$opt_echo = 1 if $opt_posix;
+
my $status = 0;
my $makefile = 0;
my (%bashisms, %string_bashisms, %singlequote_bashisms);
@@ -492,8 +495,13 @@
);
if ($opt_echo) {
- $bashisms{qr'echo\s+-[n]'} = q<echo -n>;
+ $bashisms{$LEADIN . qr'echo\s+-[A-Za-z]*n'} = q<echo -n>;
}
+ if ($opt_posix) {
+ $bashisms{$LEADIN . qr'local\s+\w+\s+'} = q<local foo>;
+ # Should include test / [ -a and -o here but we need a test
+ # which isn't FP and/or FN prone
+ }
if ($makefile) {
$string_bashisms{qr'(\$\(|\`)\s*\<\s*([^\s\)]{2,}|[^DF])\s*(\)|\`)'} =
--
To unsubscribe, send mail to [EMAIL PROTECTED]