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

lintian: r1012 - in trunk: checks debian testset testset/filenames/debian



Author: he
Date: 2007-12-01 12:24:41 +0100 (Sat, 01 Dec 2007)
New Revision: 1012

Modified:
   trunk/checks/files
   trunk/checks/files.desc
   trunk/debian/changelog
   trunk/testset/filenames/debian/control
   trunk/testset/filenames/debian/rules
   trunk/testset/tags.filenames
Log:
  + [HE] Add checks for game packages that contain no game executables
         (package-section-games-but-contains-no-game) or that contain
         anything in usr/bin at all, which is usually a mistake.
         (package-section-games-but-contains-no-game). (Closes: #451668)

Modified: trunk/checks/files
===================================================================
--- trunk/checks/files	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/checks/files	2007-12-01 11:24:41 UTC (rev 1012)
@@ -30,7 +30,8 @@
 my $type = shift;
 
 my $file;
-my $source_pkg;
+my $source_pkg = "";
+my $pkg_section = "";
 my $is_python;
 my $is_perl;
 my $has_binary_perl_file;
@@ -63,6 +64,11 @@
     chomp ($source_pkg = (<SOURCE> || ""));
 }
 
+#get section:
+if (open (SECTION, '<', "fields/section")) {
+    chomp ($pkg_section = <SECTION>);
+}
+
 # find out which files are scripts
 open(SCRIPTS, '<', "scripts") or fail("cannot open lintian scripts file: $!");
 while (<SCRIPTS>) {
@@ -810,6 +816,20 @@
 }
 close(IN);
 
+#check for sect: games but nothing in /usr/games. Check for any binary to
+#save ourselves from game-data false positives:
+if ($pkg_section =~ m{games$} && 
+    (($dir_counts{"usr/games/"} || 0) == 0) &&
+    (($dir_counts{"bin/"} || 0) + ($dir_counts{"usr/bin/"} || 0)) > 0) {
+    tag "package-section-games-but-contains-no-game";
+}
+
+if ($pkg_section =~ m{games$} && 
+    (($dir_counts{"usr/games/"} || 0)> 0) &&
+    (($dir_counts{"bin/"} || 0) + ($dir_counts{"usr/bin/"} || 0)) > 0) {
+    tag "package-section-games-but-has-usr-bin";
+}
+
 foreach my $dir (keys %dir_counts) {
     next if $dir eq "";
     next if $dir eq "./usr/lib/perl5"; #this is so common we want to skip it for now

Modified: trunk/checks/files.desc
===================================================================
--- trunk/checks/files.desc	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/checks/files.desc	2007-12-01 11:24:41 UTC (rev 1012)
@@ -694,3 +694,17 @@
 Type: warning
 Info: This package installs an empty directory.  This might be intentional
  but it's normally a mistake.  If it is intentional, add a lintian override.
+
+Tag: package-section-games-but-contains-no-game
+Type: error
+Ref: policy 11.11
+Info: This package is marked as part of the section games, but doesn't
+ contain files in <tt>/usr/games</tt>.  Binaries of games must be installed
+ in <tt>/usr/games</tt>.
+
+Tag: package-section-games-but-has-usr-bin
+Type: warning
+Ref: policy 11.11
+Info: This package is marked as part of the section games, but contains
+ exectuables in <tt>/bin</tt> or <tt>/usr/bin/</tt>.  This can be intentional,
+ but is usually a mistake.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/debian/changelog	2007-12-01 11:24:41 UTC (rev 1012)
@@ -35,6 +35,10 @@
   * checks/files:
     + [HE] Add 'package-contains-empty-directory' check, but
            ignore dirs in /var/* and /usr/lib/perl5/. (Closes: #452316)
+    + [HE] Add checks for game packages that contain no game executables
+           (package-section-games-but-contains-no-game) or that contain
+           anything in usr/bin at all, which is usually a mistake.
+           (package-section-games-but-contains-no-game). (Closes: #451668)
   * checks/patch-systems:
     + [HE] Add complete new check script, intended to check for usual
            problems when using patch systems. Start with three

Modified: trunk/testset/filenames/debian/control
===================================================================
--- trunk/testset/filenames/debian/control	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/testset/filenames/debian/control	2007-12-01 11:24:41 UTC (rev 1012)
@@ -18,3 +18,18 @@
  .
  Lintian also does not handle filenames that contain backslashes, or
  other characters that are mangled by tar's -tv output.
+
+Package: filename-games
+Architecture: all
+Depends: filenames
+Section: games
+Description: Test game filename/location checks
+ This package contains files with slightly less evil names than
+ filenames.
+
+Package: more-filename-games
+Architecture: all
+Depends: filenames, filename-games
+Section: games
+Description: More test for game filename/location checks
+ This package contains no evil names, only evil locations.

Modified: trunk/testset/filenames/debian/rules
===================================================================
--- trunk/testset/filenames/debian/rules	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/testset/filenames/debian/rules	2007-12-01 11:24:41 UTC (rev 1012)
@@ -152,9 +152,24 @@
 # Running dpkg-gencontrol without any options used to omit the section and
 # priority from the .dsc file.  Now, as of 1.13.16, -isp is the default.
 # Stimulate the same lintian check by explicitly omitting the fields.
-	dpkg-gencontrol -Usection -Upriority
+	dpkg-gencontrol -Usection -Upriority -pfilenames -Pdebian/tmp
 	dpkg --build debian/tmp ..
 
+	install -d debian/filename-games debian/filename-games/DEBIAN
+	install -d debian/filename-games/usr debian/filename-games/usr/games debian/filename-games/usr/bin
+	echo '#! /bin/sh' > debian/filename-games/usr/bin/test-game
+	chmod 755 debian/filename-games/usr/bin/test-game
+	dpkg-gencontrol -pfilename-games -Pdebian/filename-games
+	dpkg --build debian/filename-games ..
+
+	install -d debian/more-filename-games debian/more-filename-games/DEBIAN
+	install -d debian/more-filename-games/usr debian/more-filename-games/usr/games debian/more-filename-games/usr/bin
+	echo '#! /bin/sh' > debian/more-filename-games/usr/bin/another-test-game
+	echo '#! /bin/sh' > debian/more-filename-games/usr/games/yet-another-test-game
+	chmod 755 debian/more-filename-games/usr/bin/another-test-game debian/more-filename-games/usr/games/yet-another-test-game
+	dpkg-gencontrol -pmore-filename-games -Pdebian/more-filename-games
+	dpkg --build debian/more-filename-games ..
+
 binary: binary-arch binary-indep
 
 .PHONY: build binary-arch binary-indep binary clean

Modified: trunk/testset/tags.filenames
===================================================================
--- trunk/testset/tags.filenames	2007-12-01 11:17:56 UTC (rev 1011)
+++ trunk/testset/tags.filenames	2007-12-01 11:24:41 UTC (rev 1012)
@@ -1,3 +1,5 @@
+E: filename-games: no-copyright-file
+E: filename-games: package-section-games-but-contains-no-game
 E: filenames: bad-menu-file-name usr/lib/menu/menu
 E: filenames: bad-menu-file-name usr/share/menu/menu
 E: filenames: dir-or-file-in-srv srv/foo/
@@ -26,8 +28,13 @@
 E: filenames: symlink-should-be-relative usr/lib/filenames/symlink3wrong /usr/lib/filenames/symlink2
 E: filenames: use-of-compat-symlink usr/bin/X11/
 E: filenames: use-of-compat-symlink usr/bin/X11/testxbin
+E: more-filename-games: no-copyright-file
+I: filename-games: no-md5sums-control-file
 I: filenames: file-in-usr-something-x11-without-pre-depends usr/include/X11/
 I: filenames: no-md5sums-control-file
+I: more-filename-games: no-md5sums-control-file
+W: filename-games: binary-without-manpage usr/bin/test-game
+W: filename-games: package-contains-empty-directory usr/games/
 W: filenames source: ancient-standards-version 3.1.1 (current is 3.7.2)
 W: filenames source: diff-contains-arch-control-dir .arch-ids
 W: filenames source: diff-contains-arch-control-dir {arch}
@@ -100,3 +107,6 @@
 W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/examples/very_interesting_example
 W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/examples/very_interesting_example2.gz
 W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/news.debian.gz
+W: more-filename-games: binary-without-manpage usr/bin/another-test-game
+W: more-filename-games: binary-without-manpage usr/games/yet-another-test-game
+W: more-filename-games: package-section-games-but-has-usr-bin



Reply to: