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

lintian: r1172 - in trunk: checks debian testset testset/maintainer-scripts/debian



Author: rra
Date: 2008-02-05 02:20:41 +0100 (Tue, 05 Feb 2008)
New Revision: 1172

Modified:
   trunk/checks/scripts
   trunk/debian/changelog
   trunk/testset/maintainer-scripts/debian/postinst
   trunk/testset/tags.maintainer-scripts
Log:
  + [RA] Integrate several more bashism checks from checkbashisms in
    devscripts.  Patch from Adam D. Barratt.  (Closes: #464026)

Modified: trunk/checks/scripts
===================================================================
--- trunk/checks/scripts	2008-02-04 08:16:17 UTC (rev 1171)
+++ trunk/checks/scripts	2008-02-05 01:20:41 UTC (rev 1172)
@@ -530,6 +530,10 @@
 		  '\$\{\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)
+		  '\$RANDOM\b',		       # $RANDOM
 		);
 		my @bashism_regexs = (
 		  'function \w+\(\s*\)',       # function is useless
@@ -544,6 +548,13 @@
 		  '(?:^|\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
+		  '(?:^|\s+)echo\s+-e',        # echo -e
+		  '(?:^|\s+)exec\s+-[acl]',    # exec -c/-l/-a name
+		  '(?:^|\s+)let\s',	       # let ...
+		  '(?<!\$)\(\(',	       # '((' should be '$(('
+		  '(\[|test)\s+-a',	       # test with unary -a (should be -e)
 		);
 
 		# since this test is ugly, I have to do it by itself

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-02-04 08:16:17 UTC (rev 1171)
+++ trunk/debian/changelog	2008-02-05 01:20:41 UTC (rev 1172)
@@ -98,6 +98,8 @@
       (Closes: #463281)
     + [RA] Catch exec wrappers that use $* instead of $@ (not that this is
       a good idea).  Thanks, Adam D. Barratt.  (Closes: #463476)
+    + [RA] Integrate several more bashism checks from checkbashisms in
+      devscripts.  Patch from Adam D. Barratt.  (Closes: #464026)
 
   * debian/control:
     + [RA] Suggest man-db >= 2.5.1 for better warning support.

Modified: trunk/testset/maintainer-scripts/debian/postinst
===================================================================
--- trunk/testset/maintainer-scripts/debian/postinst	2008-02-04 08:16:17 UTC (rev 1171)
+++ trunk/testset/maintainer-scripts/debian/postinst	2008-02-05 01:20:41 UTC (rev 1172)
@@ -111,3 +111,19 @@
 # Recognize single quotes even if they start at the beginning of a line.
 echo not a bashism \
 '/{ptex,tex}/{amstex,plain,generic,}'
+
+# More bashisms.
+echo -e 'foo\n'
+echo "${!foo}"
+cat $(\< file)
+select foo in a b ; do echo $foo ; done
+cnt=$((cnt + 1))
+if false ; then
+    exec -l /bin/sh
+    exec -c /bin/sh
+    exec -a foo /bin/sh
+fi
+let cnt++
+if test -a /etc/default ; then
+    echo "$RANDOM|stuff"
+fi

Modified: trunk/testset/tags.maintainer-scripts
===================================================================
--- trunk/testset/tags.maintainer-scripts	2008-02-04 08:16:17 UTC (rev 1171)
+++ trunk/testset/tags.maintainer-scripts	2008-02-05 01:20:41 UTC (rev 1172)
@@ -43,6 +43,16 @@
 W: maintainer-scripts: missing-debconf-dependency
 W: maintainer-scripts: no-debconf-templates
 W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:108 '${H[@]}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:116 'echo -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:117 '${!foo}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:119 'select foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:120 '$((c'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:122 '    exec -l'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:123 '    exec -c'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:124 '    exec -a'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:126 'let '
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:127 'test -a'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:128 '$RANDOM'
 W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:15 '. /usr/share/lintian/shell foo'
 W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:18 'read'
 W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:20 'H[0]='


Reply to: