[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#464026: [checks/scripts] Sync bashism tests with checkbashisms



Package: lintian
Version: 1.2.42
Tags: patch
X-Debbugs-Cc: pkg-devscripts@teams.debian.net

Hi,

As discussed recently, please find attached a patch (against lintian and
devscripts SVN) to checks/scripts that adds the bashism tests that
devscripts's checkbashisms performs but lintian does not.

The only test I've not included is that for "echo -n". That test is
optional in checkbashisms as Policy requires that it be supported.

Regards,

Adam
--- checks/scripts.orig	2008-02-04 18:48:25.000000000 +0000
+++ checks/scripts	2008-02-04 19:05:57.000000000 +0000
@@ -530,6 +530,9 @@
 		  '\$\{\w+\:\d+(?::\d+)?\}',   # ${foo:3[:1]}
 		  '\$\{\w+(/.+?){1,2}\}',      # ${parm/?/pat[/str]}
 		  '\$\{\#?\w+\[[0-9\*\@]+\]\}',# bash arrays, ${name[0|*|@]}
+		  '\$\{!\w+[\@*]\}',           # ${!prefix[*|@]}
+		  '\$\{!\w+\}',                # ${!name}
+		  '(\$\(|\`)\s*\<\s*\S.+(\)|\`)',# $(\< foo)' should be '$(cat foo)'
 		);
 		my @bashism_regexs = (
 		  'function \w+\(\s*\)',       # function is useless
@@ -544,6 +547,14 @@
 		  '(?:^|\s+)trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers
 		  '\&>',		       # cshism
 		  '\[\[(?!:)',		       # alternative test command
+		  '(?:^|\s+)select\s+\w+',     # 'select' is not POSIX
+		  '\$\(\([A-Za-z]',            # cnt=$((cnt + 1)) does not work in dash
+		  'echo\s+-[e]',	       # echo -e
+		  'exec\s+-[acl]',             # exec -c/-l/-a name
+		  '\blet\s',                   # let ...
+		  '\$RANDOM\b',                # $RANDOM
+		  '(?<!\$)\(\(',               # '((' should be '$(('
+		  '(\[|test)\s+-a',            # test with unary -a (should be -e)
 		);
 
 		# since this test is ugly, I have to do it by itself

Reply to: