Author: adam-guest
Date: 2008-02-23 21:38:57 +0000 (Sat, 23 Feb 2008)
New Revision: 1046
Modified:
trunk/debian/changelog
trunk/scripts/checkbashisms.pl
Log:
checkbashisms:
+ Add detection for <<<, $(OS|MACH)TYPE, $HOST(TYPE|NAME), $EUID and
$DIRSTACK (Closes: #465386)
+ Enhance heredoc detection to not trigger on <<<
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-02-23 16:34:17 UTC (rev 1045)
+++ trunk/debian/changelog 2008-02-23 21:38:57 UTC (rev 1046)
@@ -1,7 +1,11 @@
devscripts (2.10.17) UNRELEASED; urgency=low
[ Adam D. Barratt ]
- * checkbashisms: Fix a false positive in the $(( test (Closes: #465364)
+ * checkbashisms:
+ + Fix a false positive in the $(( test (Closes: #465364)
+ + Add detection for <<<, $(OS|MACH)TYPE, $HOST(TYPE|NAME), $EUID and
+ $DIRSTACK (Closes: #465386)
+ + Enhance heredoc detection to not trigger on <<<
* Debbugs.pm: Add status()
* tagpending:
+ Rewrite in perl using Debbugs.pm
Modified: trunk/scripts/checkbashisms.pl
===================================================================
--- trunk/scripts/checkbashisms.pl 2008-02-23 16:34:17 UTC (rev 1045)
+++ trunk/scripts/checkbashisms.pl 2008-02-23 21:38:57 UTC (rev 1046)
@@ -127,7 +127,7 @@
'(?:^|\s+)echo\s+-[e]' => q<echo -e>,
'(?:^|\s+)exec\s+-[acl]' => q<exec -c/-l/-a name>,
'(?:^|\s+)let\s' => q<let ...>,
- '\$RANDOM\b' => q<$RANDOM>,
+ '\$RANDOM(\b|$)' => q<$RANDOM>,
'(?<![\$\(])\(\(.*\)\)' => q<'((' should be '$(('>,
'(\[|test)\s+-a' => q<test with unary -a (should be
-e)>,
'\&>' => q<should be \>word 2\>&1>,
@@ -136,6 +136,11 @@
'(?:^|\s+)kill\s+-[^sl]\w*' => q<kill -[0-9] or -[A-Z]>,
'(?:^|\s+)trap\s+["\']?.*["\']?\s+.*[1-9]' => q<trap with
signal numbers>,
'\[\[(?!:)' => q<alternative test command ([[ foo ]] should be
[ foo ])>,
+ '<<<' => q<\<\<\< here string>,
+ '\$(OS|MACH)TYPE(\b|$)' => q<$(OS|MACH)TYPE>,
+ '\$HOST(TYPE|NAME)(\b|$)' => q<$HOST(TYPE|NAME)>,
+ '\$DIRSTACK(\b|$)' => q<$DIRSTACK>,
+ '\$EUID(\b|$)' => q<$EUID should be "id -u">,
);
my %string_bashisms = (
@@ -199,7 +204,7 @@
# Only look for the beginning of a heredoc here, after we've
# stripped out quoted material, to avoid false positives.
- if (m/\<\<\s*[\'\"]?(\w+)[\'\"]?/) {
+ if (m/(^|[^\<])\<\<\s*[\'\"]?(\w+)[\'\"]?/) {
$cat_string = $1;
}
}
--
To unsubscribe, send mail to [EMAIL PROTECTED]