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

lintian: r642 - in trunk: checks debian testset testset/scripts testset/scripts/debian



Author: rra
Date: 2006-04-27 08:09:49 +0200 (Thu, 27 Apr 2006)
New Revision: 642

Added:
   trunk/testset/scripts/gccbug.dpatch
Modified:
   trunk/checks/scripts
   trunk/debian/changelog
   trunk/testset/scripts/debian/rules
   trunk/testset/tags.scripts
Log:
  + [RA] Don't syntax-check *.dpatch scripts in /usr/src.  bash -n
    doesn't stop at exit 0 and then may choke on the patch.  Thanks,
    Matthias Klose.  (Closes: #364521)

Modified: trunk/checks/scripts
===================================================================
--- trunk/checks/scripts	2006-04-27 05:50:58 UTC (rev 641)
+++ trunk/checks/scripts	2006-04-27 06:09:49 UTC (rev 642)
@@ -328,10 +328,15 @@
     tag_warn("csh-considered-harmful", $filename)
         if (($base eq 'csh' or $base eq 'tcsh') and $executable{$filename});
 
+    # Don't syntax-check scripts in /usr/src that end in .dpatch.  bash -n
+    # doesn't stop checking at exit 0 and goes on to blow up on the patch
+    # itself.
     if ($base =~ /^(?:(?:b|d)?a|k|z)?sh$/) {
 	if (-x "$interpreter" && ! script_is_evil_and_wrong("unpacked/$filename")) {
-	    if (check_script_syntax($interpreter, "unpacked/$filename")) {
-		tag_error("shell-script-fails-syntax-check", $filename);
+	    if ($filename !~ m,^./usr/src/.*\.dpatch$,) {
+		if (check_script_syntax($interpreter, "unpacked/$filename")) {
+		    tag_error("shell-script-fails-syntax-check", $filename);
+		}
 	    }
 	}
 	next;

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-04-27 05:50:58 UTC (rev 641)
+++ trunk/debian/changelog	2006-04-27 06:09:49 UTC (rev 642)
@@ -16,6 +16,9 @@
       #! magic and they rely on being run from a shell.  Revert the change
       that permitted the Perl magic without a #! line.  Thanks to Piotr
       Engelking and Steve Langasek for pointing this out.
+    + [RA] Don't syntax-check *.dpatch scripts in /usr/src.  bash -n
+      doesn't stop at exit 0 and then may choke on the patch.  Thanks,
+      Matthias Klose.  (Closes: #364521)
   * checks/scripts.desc:
     + [RA] Using invoke-rc.d is now required by Policy.
   * checks/standards-version:
@@ -25,7 +28,7 @@
     + [RA] Update standards version to 3.7.0 (no changes required).
     + [RA] Update description to note calibration for Policy 3.7.0.
 
- -- Russ Allbery <rra@debian.org>  Wed, 26 Apr 2006 22:30:07 -0700
+ -- Russ Allbery <rra@debian.org>  Wed, 26 Apr 2006 23:07:13 -0700
 
 lintian (1.23.18) unstable; urgency=low
 

Modified: trunk/testset/scripts/debian/rules
===================================================================
--- trunk/testset/scripts/debian/rules	2006-04-27 05:50:58 UTC (rev 641)
+++ trunk/testset/scripts/debian/rules	2006-04-27 06:09:49 UTC (rev 642)
@@ -13,6 +13,7 @@
 	install -d $(tmp)/usr/share/doc/scripts/
 	install -d $(tmp)/usr/lib/python2.3/site-packages/
 	install -d $(tmp)/usr/lib/cgi-bin
+	install -d $(tmp)/usr/src/scripts
 	install -d $(tmp)/DEBIAN
 
 	install -m 755 pyfoo $(tmp)/usr/bin/
@@ -29,6 +30,10 @@
 	install -m 755 perl-bizarre-2 $(tmp)/usr/bin/
 	install -m 755 perl-bizarre-3 $(tmp)/usr/bin/
 
+# First one should produce a warning; second one shouldn't.
+	install -m 755 gccbug.dpatch $(tmp)/usr/share/scripts/
+	install -m 755 gccbug.dpatch $(tmp)/usr/src/scripts/
+
 	echo "#!/usr/bin/perl" >> $(tmp)/usr/share/scripts/foobar.in
 	chmod 644 $(tmp)/usr/share/scripts/foobar.in
 

Added: trunk/testset/scripts/gccbug.dpatch
===================================================================
--- trunk/testset/scripts/gccbug.dpatch	2006-04-27 05:50:58 UTC (rev 641)
+++ trunk/testset/scripts/gccbug.dpatch	2006-04-27 06:09:49 UTC (rev 642)
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+
+# DP: Use sensible-editor instead of vi as fallback editor
+
+# Taken from gcc-4.1-source.  Chokes bash -n (due to the patch) despite being
+# a valid dpatch, so don't warn about it if it's in /usr/src.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    dir="$3/"
+elif [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p0 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- gcc/gccbug.in~	2003-03-01 00:51:42.000000000 +0100
++++ gcc/gccbug.in	2003-03-02 12:08:36.000000000 +0100
+@@ -134,7 +134,7 @@
+ # If they don't have a preferred editor set, then use
+ if [ -z "$VISUAL" ]; then
+   if [ -z "$EDITOR" ]; then
+-    EDIT=vi
++    EDIT=/usr/bin/sensible-editor
+   else
+     EDIT="$EDITOR"
+   fi


Property changes on: trunk/testset/scripts/gccbug.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/testset/tags.scripts
===================================================================
--- trunk/testset/tags.scripts	2006-04-27 05:50:58 UTC (rev 641)
+++ trunk/testset/tags.scripts	2006-04-27 06:09:49 UTC (rev 642)
@@ -4,6 +4,7 @@
 E: scripts: no-copyright-file
 E: scripts: python-script-but-no-python-dep ./usr/bin/py2foo
 E: scripts: python-script-but-no-python-dep ./usr/bin/pyfoo
+E: scripts: shell-script-fails-syntax-check ./usr/share/scripts/gccbug.dpatch
 E: scripts: suid-perl-script-but-no-perl-suid-dep ./usr/bin/suidperlfoo2
 E: scripts: wrong-path-for-interpreter #!/usr/local/bin/lefty != /usr/bin/lefty (./usr/bin/lefty-foo)
 E: scripts: wrong-path-for-ruby ./usr/bin/rubyfoo #!/bin/ruby1.8



Reply to: