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

lintian: r973 - in trunk: checks debian testset testset/binary/debian



Author: rra
Date: 2007-10-15 06:19:12 +0200 (Mon, 15 Oct 2007)
New Revision: 973

Modified:
   trunk/checks/files
   trunk/checks/files.desc
   trunk/checks/menus
   trunk/checks/menus.desc
   trunk/debian/changelog
   trunk/testset/binary/debian/doc-base
   trunk/testset/binary/debian/rules
   trunk/testset/tags.binary
   trunk/testset/tags.filenames
Log:
  + [RA] Diagnose files with names ending in whitespace.
  + [RA] Use the three-argument form of open to not fail on doc-base
    files ending in whitespace.  Error on doc-base files with Document
    fields that end in whitespace, since currently they break multiple
    tools.  Thanks, Ian Zimmerman.  (Closes: #444889)

Modified: trunk/checks/files
===================================================================
--- trunk/checks/files	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/checks/files	2007-10-15 04:19:12 UTC (rev 973)
@@ -518,6 +518,10 @@
 	tag "extra-license-file", "$file";
     }
 
+    # ---------------- weird file names
+    if ($file =~ m,\s+\z,) {
+	tag "file-name-ends-in-whitespace", "$file";
+    }
 
     # ---------------- plain files
     if ($perm =~ m/^-/) {
@@ -689,7 +693,7 @@
     # ---------------- symbolic links
     elsif ($perm =~ m/^l/) {
 	# link
-	
+
 	my $mylink = $link;
 	if ($mylink =~ s,//+,/,g) {
 	    tag "symlink-has-double-slash", "$file $link";
@@ -779,7 +783,7 @@
 	    }
 	}
     NEXT_LINK:
-	
+
 	if ($link =~ m,\.(gz|z|Z|bz|bz2|tgz|zip)\s*$,) {
 	    # symlink is pointing to a compressed file
 

Modified: trunk/checks/files.desc
===================================================================
--- trunk/checks/files.desc	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/checks/files.desc	2007-10-15 04:19:12 UTC (rev 973)
@@ -668,3 +668,12 @@
 Info: This package installs a file in <tt>/usr/lib/sgml</tt>.  This was
  the old location for SGML catalogs and similar flies.  All those files
  should now go into <tt>/usr/share/sgml</tt>.
+
+Tag: file-name-ends-in-whitespace
+Type: warning
+Info: This package installs a file or directory whose name ends in
+ whitespace.  This might be intentional but it's normally a mistake.  If
+ it is intentional, add a lintian override.
+ .
+ One possible cause is using debhelper 5.0.57 or earlier to install a
+ doc-base file with a Document field that ends in whitespace.

Modified: trunk/checks/menus
===================================================================
--- trunk/checks/menus	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/checks/menus	2007-10-15 04:19:12 UTC (rev 973)
@@ -163,7 +163,7 @@
     while (my $dbfile = readdir DOCBASEDIR) {
 	# don't try to parse executables, plus we already warned about it
 	next if -x "doc-base/$dbfile";
-	open IN, "doc-base/$dbfile" or
+	open (IN, '<', "doc-base/$dbfile") or
 	    fail("cannot open doc-base file $dbfile for reading.");
 
 	# Check if files referenced by doc-base are included in the package.
@@ -228,6 +228,8 @@
 		    unless $known_doc_base_formats{$format};
 	    } elsif (defined ($_) && /^Document\s*:/i) {
 		$sawdocument = 1;
+                tag "doc-base-document-field-ends-in-whitespace", "$dbfile:$."
+                    if /[ \t]$/;
 	    } elsif (defined ($_) && /^\s/ && $field) {
 		push (@files, split ' ');
 	    }

Modified: trunk/checks/menus.desc
===================================================================
--- trunk/checks/menus.desc	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/checks/menus.desc	2007-10-15 04:19:12 UTC (rev 973)
@@ -191,3 +191,10 @@
  documentation.  Even if the documentation is a single file, this field
  must be present.
 Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-document-field-ends-in-whitespace
+Type: error
+Info: The Document field in a doc-base file should not end in whitespace.
+ doc-base (at least as of 0.8.5) cannot cope with such fields and
+ debhelper 5.0.57 or earlier may create files ending in whitespace when
+ installing such files.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/debian/changelog	2007-10-15 04:19:12 UTC (rev 973)
@@ -43,6 +43,7 @@
     + [RA] Improve the recommended command to remove .packlist files.
       Thanks, Justin Pryzby.
     + [RA] Don't think hard links are zero-length files.
+    + [RA] Diagnose files with names ending in whitespace.
   * checks/infofiles:
     + [RA] Emacs 22 now allows embedded images in info files, so accept
       and ignore PNG files in the info directory.  More image types may be
@@ -57,6 +58,10 @@
       is widely used.  Thanks, Raphael Geissert.  (Closes: #444651)
   * checks/menus:
     + [RA] Find the targets of hard links correctly.  (Closes: #444355)
+    + [RA] Use the three-argument form of open to not fail on doc-base
+      files ending in whitespace.  Error on doc-base files with Document
+      fields that end in whitespace, since currently they break multiple
+      tools.  Thanks, Ian Zimmerman.  (Closes: #444889)
   * checks/nmu.desc:
     + [RA] Remove obsolete note about binary NMUs.  Patch from Thijs
       Kinkhorst.  (Closes: #437925)
@@ -71,7 +76,7 @@
   * collection/changelog-file{.desc,}:
     + [RA] Collect NEWS.Debian as well as changelog.
 
- -- Russ Allbery <rra@debian.org>  Sun, 14 Oct 2007 20:40:24 -0700
+ -- Russ Allbery <rra@debian.org>  Sun, 14 Oct 2007 21:19:01 -0700
 
 lintian (1.23.34) unstable; urgency=low
 

Modified: trunk/testset/binary/debian/doc-base
===================================================================
--- trunk/testset/binary/debian/doc-base	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/testset/binary/debian/doc-base	2007-10-15 04:19:12 UTC (rev 973)
@@ -1,4 +1,4 @@
-Document: binary!docs
+Document: binary!docs  
 Title: Broken binary doc-base control file
 Author: Russ Allbery
 Abstract: This control file exercises various tests of doc-base control

Modified: trunk/testset/binary/debian/rules
===================================================================
--- trunk/testset/binary/debian/rules	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/testset/binary/debian/rules	2007-10-15 04:19:12 UTC (rev 973)
@@ -43,6 +43,7 @@
 	install -m 644 debian/menu $(tmp)/usr/lib/menu/binary
 	install -d $(tmp)/usr/share/doc-base
 	install -m 644 debian/doc-base $(tmp)/usr/share/doc-base/binary
+	touch '$(tmp)/usr/share/doc-base/space '
 	install -m 644 debian/README.Debian $(tmp)/usr/share/doc/binary
 	install -m 644 debian/NEWS.Debian $(tmp)/usr/share/doc/binary
 	gzip -9 $(tmp)/usr/share/doc/binary/NEWS.Debian

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/testset/tags.binary	2007-10-15 04:19:12 UTC (rev 973)
@@ -4,6 +4,7 @@
 E: binary: debian-news-file-uses-obsolete-national-encoding at line 3
 E: binary: depends-on-x-metapackage depends: xorg
 E: binary: desktop-entry-missing-required-key ./usr/share/applications/goodbye.desktop Name
+E: binary: doc-base-document-field-ends-in-whitespace binary:1
 E: binary: doc-base-file-no-format binary:22
 E: binary: doc-base-file-no-index binary:31
 E: binary: doc-base-file-references-missing-file binary:13 /usr/share/doc/binary/binary.sgml.gz
@@ -21,10 +22,10 @@
 E: binary: menu-item-missing-required-tag section /usr/share/menu/binary:1
 E: binary: non-wm-in-windowmanager-menu-section x11 /usr/lib/menu/binary:4
 E: binary: non-wm-in-windowmanager-menu-section x11 /usr/share/menu/binary:4
-E: binary: postinst-does-not-call-installdocs usr/share/doc-base/binary
+E: binary: postinst-does-not-call-installdocs usr/share/doc-base/space 
 E: binary: postinst-does-not-call-updatemenus usr/share/menu/binary
 E: binary: postrm-does-not-call-updatemenus usr/share/menu/binary
-E: binary: prerm-does-not-call-installdocs usr/share/doc-base/binary
+E: binary: prerm-does-not-call-installdocs usr/share/doc-base/space 
 E: binary: statically-linked-binary ./usr/bin/static-hello
 E: binary: su-wrapper-without--c /usr/lib/menu/binary:2 su-to-root
 E: binary: su-wrapper-without--c /usr/lib/menu/binary:3 sux
@@ -68,6 +69,7 @@
 W: binary: file-in-unusual-dir usr/bar
 W: binary: file-in-unusual-dir usr/bar2
 W: binary: file-in-unusual-dir usr/foo
+W: binary: file-name-ends-in-whitespace usr/share/doc-base/space 
 W: binary: menu-command-not-in-package /usr/lib/menu/binary:18 imnothere
 W: binary: menu-command-not-in-package /usr/lib/menu/binary:20 cfdisk
 W: binary: menu-command-not-in-package /usr/lib/menu/binary:4 xfdisk

Modified: trunk/testset/tags.filenames
===================================================================
--- trunk/testset/tags.filenames	2007-10-15 03:56:32 UTC (rev 972)
+++ trunk/testset/tags.filenames	2007-10-15 04:19:12 UTC (rev 973)
@@ -65,6 +65,7 @@
 W: filenames: file-in-unusual-dir files/svn-commit.tmp
 W: filenames: file-in-unusual-dir srv/foo/bar
 W: filenames: file-in-usr-lib-sgml usr/lib/sgml/package
+W: filenames: file-name-ends-in-whitespace files/'\\ 
 W: filenames: macos-ds-store-file-in-package usr/share/doc/filenames/.DS_Store
 W: filenames: menu-file-in-usr-lib usr/lib/menu/menu
 W: filenames: no-priority-field



Reply to: