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

[SCM] Debian package checker branch, master, updated. 1.24.3-2-g12016c1



The following commit has been merged in the master branch:
commit 12016c1135f14011576421b550b6fe7ae28f5a15
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Sat Aug 9 16:25:27 2008 +0100

    Fix uninitialized value warnings from the read bashism test (Closes: #494450)
    
    Split the "read without variable or with invalid options" test in two.
    This allows the regexes to be simpler and more comprehensive and
    avoids an uninitialized value warning when matching against them.

diff --git a/checks/scripts b/checks/scripts
index 1712b59..9abddc2 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -565,8 +565,10 @@ while (<SCRIPTS>) {
 		  qr'\s(\|\&)',		         # pipelining is not POSIX
 		  qr'[^\\\$]\{(?:[^\s\\\}]+?,)+[^\\\}\s]+\}', # brace expansion
 		  qr'(?:^|\s+)\w+\[\d+\]=',      # bash arrays, H[0]
-		  $LEADIN . qr'(read\s*(-[^r]+)*(?:;|$))',
-			# read without variable or with option other than -r
+		  $LEADIN . qr'read\s+(?:-[a-qs-zA-Z\d-]+)',
+			# read with option other than -r
+		  $LEADIN . qr'read\s*(?:-\w+\s*)*(?:\".*?\"|[\'].*?[\'])?\s*(?:;|$)',
+			# read without variable
 		  $LEADIN . qr'kill\s+-[^sl]\w*',# kill -[0-9] or -[A-Z]
 		  $LEADIN . qr'trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers
 		  qr'\&>',		         # cshism
diff --git a/debian/changelog b/debian/changelog
index c2e9771..ff660c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 lintian (1.24.4) UNRELEASED; urgency=low
 
+  * checks/scripts:
+    + [ADB] Split the "read without variable or with invalid options" bashism
+      test in two, thus enabling the checks to be more accurate and avoiding
+      an uninitialized variable warning.  (Closes: #494450)
   * checks/shared-libs.desc:
     + [RA] Clarify that shlibs-declares-dependency-on-other-package can be
       issued for a version mismatch.  (Closes: #494400)
diff --git a/testset/tags.maintainer-scripts b/testset/tags.maintainer-scripts
index 81659c3..bcab8c3 100644
--- a/testset/tags.maintainer-scripts
+++ b/testset/tags.maintainer-scripts
@@ -116,7 +116,7 @@ W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:31 'trap "ech
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:33 '[['
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:34 '    kill -HUP'
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:52 '${line:3:1}'
-W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:62 'read -x foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:62 'read -x'
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:63 'read -x'
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:66 'read'
 W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:68 'echo "a\\b"'

-- 
Debian package checker


Reply to: