Author: rra Date: 2008-03-03 05:28:46 +0100 (Mon, 03 Mar 2008) New Revision: 1229
Modified: trunk/checks/scripts trunk/debian/changelog Log: Update regexes from checkbashisms. Modified: trunk/checks/scripts =================================================================== --- trunk/checks/scripts 2008-02-22 17:18:57 UTC (rev 1228) +++ trunk/checks/scripts 2008-03-03 04:28:46 UTC (rev 1229) @@ -541,8 +541,12 @@ '[EMAIL PROTECTED]',# bash arrays, ${name[0|*|@]} '[EMAIL PROTECTED]', # ${!prefix[*|@]} '\$\{!\w+\}', # ${!name} - '(\$\(|\`)\s*\<\s*\S.+(\)|\`)', # $(\< foo) should be $(cat foo) + '(\$\(|\`)\s*\<\s*\S+\s*(\)|\`)', # $(\< foo) should be $(cat foo) '\$RANDOM\b', # $RANDOM + '\$(OS|MACH)TYPE\b', # $(OS|MACH)TYPE + '\$HOST(TYPE|NAME)\b', # $HOST(TYPE|NAME) + '\$DIRSTACK\b', # $DIRSTACK + '\$EUID\b', # $EUID should be "id -u" ); my @bashism_regexs = ( 'function \w+\(\s*\)', # function is useless @@ -556,6 +560,7 @@ '(?:^|\s+)kill\s+-[^sl]\w*', # kill -[0-9] or -[A-Z] '(?:^|\s+)trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers '\&>', # cshism + '(<\&|>\&)\s*((-|\d+)[^\s;|\)\`&]|[^-\d])', # should be >word 2>&1 '\[\[(?!:)', # alternative test command '(?:^|\s+)select\s+\w+', # 'select' is not POSIX '\$\(\([A-Za-z]', # cnt=$((cnt + 1)) does not work in dash @@ -564,6 +569,7 @@ '(?:^|\s+)let\s', # let ... '(?<![\$\(])\(\(.*\)\)', # '((' should be '$((' '(\[|test)\s+-a', # test with unary -a (should be -e) + '<<<', # <<< here string ); # since this test is ugly, I have to do it by itself @@ -610,7 +616,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; } } Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2008-02-22 17:18:57 UTC (rev 1228) +++ trunk/debian/changelog 2008-03-03 04:28:46 UTC (rev 1229) @@ -51,7 +51,7 @@ doesn't seem to have any actual code. Based on an idea by Justin Pryzby. (Closes: #410042) + [RA] Update regexes based on checkbashisms to remove additional - false positives. Thanks, Adam D. Barratt. + false positives and add additional checks. Thanks, Adam D. Barratt. + [RA] Add kaptain. Thanks, Tobias Toedter. (Closes: #466701) * frontend/lintian: -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]