lintian: r1007 - in trunk: checks debian testset
Author: he
Date: 2007-11-30 21:02:31 +0100 (Fri, 30 Nov 2007)
New Revision: 1007
Modified:
trunk/checks/files
trunk/checks/files.desc
trunk/debian/changelog
trunk/testset/tags.filenames
Log:
* checks/files:
+ [HE] Add 'package-contains-empty-directory' check, but
ignore dirs in /var/* and /usr/lib/perl5/. (Closes: #452316)
Modified: trunk/checks/files
===================================================================
--- trunk/checks/files 2007-11-30 20:00:46 UTC (rev 1006)
+++ trunk/checks/files 2007-11-30 20:02:31 UTC (rev 1007)
@@ -75,6 +75,8 @@
# We only want to warn about this once.
my $warned_x11_predepends = 0;
+my %dir_counts;
+
# Read package contents...
open(IN, '<', "index") or fail("cannot open index file index: $!");
while (<IN>) {
@@ -115,6 +117,10 @@
tag "package-contains-ancient-file", "$file $date";
}
+ #count directory contents:
+ $dir_counts{$file} ||= 0 if ($perm =~ m/^d/);
+ $dir_counts{$1} = ($dir_counts{$1} || 0) + 1 if ($file =~ m{^(.+/)[^/]+/?$});
+
# ---------------- /etc
if ($file =~ m,^etc/,) {
if ($file =~ m,^etc/nntpserver, ) {
@@ -804,6 +810,15 @@
}
close(IN);
+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
+ next if $dir =~ m{/var/}; #packages often create dirs to hold dynamically created data
+ if ($dir_counts{$dir} == 0) {
+ tag "package-contains-empty-directory", $dir;
+ }
+}
+
if (!$has_binary_perl_file && @nonbinary_perl_files_in_lib) {
foreach my $file (@nonbinary_perl_files_in_lib) {
tag "package-installs-nonbinary-perl-in-usr-lib-perl5", "$file";
Modified: trunk/checks/files.desc
===================================================================
--- trunk/checks/files.desc 2007-11-30 20:00:46 UTC (rev 1006)
+++ trunk/checks/files.desc 2007-11-30 20:02:31 UTC (rev 1007)
@@ -689,3 +689,8 @@
.
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.
+
+Tag: package-contains-empty-directory
+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.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-11-30 20:00:46 UTC (rev 1006)
+++ trunk/debian/changelog 2007-11-30 20:02:31 UTC (rev 1007)
@@ -32,6 +32,9 @@
stolen from linda. (Closes: #452839)
+ [HE] Check for Section field in source packages, for which it
is mandatory. Joerg Jaspert made me do this.
+ * checks/files:
+ + [HE] Add 'package-contains-empty-directory' check, but
+ ignore dirs in /var/* and /usr/lib/perl5/. (Closes: #452316)
* 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/tags.filenames
===================================================================
--- trunk/testset/tags.filenames 2007-11-30 20:00:46 UTC (rev 1006)
+++ trunk/testset/tags.filenames 2007-11-30 20:02:31 UTC (rev 1007)
@@ -77,6 +77,11 @@
W: filenames: package-contains-arch-control-dir usr/lib/perl5/.arch-ids/
W: filenames: package-contains-arch-control-dir usr/lib/perl5/{arch}/
W: filenames: package-contains-bzr-control-dir usr/lib/perl5/.bzr/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.arch-ids/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.bzr/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.svn/
+W: filenames: package-contains-empty-directory usr/lib/perl5/CVS/
+W: filenames: package-contains-empty-directory usr/lib/perl5/{arch}/
W: filenames: package-contains-readme-for-other-platform-or-distro usr/share/doc/filenames/README.macosx
W: filenames: package-contains-svn-control-dir usr/lib/perl5/.svn/
W: filenames: package-installs-into-etc-gconf-schemas etc/gconf/schemas/test.schema
Reply to: