[SCM] Debian package checker branch, master, updated. 2.3.3-56-g5ddc15f
The following commit has been merged in the master branch:
commit 12fe5c7ce8fc0bc0780a208238afb9074eda48ce
Author: Luca Falavigna <dktrkranz@debian.org>
Date: Sat Mar 20 21:07:10 2010 -0700
Check for empty binary packages
Try to catch empty binary packages that are not meta-packages or
transitional packages.
diff --git a/checks/files b/checks/files
index cb1171b..106a243 100644
--- a/checks/files
+++ b/checks/files
@@ -21,6 +21,7 @@
package Lintian::files;
use strict;
use Util;
+use File::Basename;
use Lintian::Data;
use Lintian::Tags qw(tag);
@@ -117,6 +118,30 @@ our @flash_nonfree = (
# qr,(?i)xspf_jukebox\.swf$,
);
+# List of entries to identify metapackages
+our @metapkg_match = (
+ "metapackage",
+ "meta package",
+ "meta-package",
+ "dummy",
+ "dependency package",
+ "empty package",
+ "virtual package"
+);
+
+# List of common files stored in /usr/share/doc/$pkg
+our @doc_files = (
+ "AUTHORS.gz",
+ "NEWS.gz",
+ "README.gz",
+ "COPYING.gz",
+ "HACKING.gz",
+ "TODO.gz",
+ "copyright.gz",
+ "changelog.gz",
+ "changelog.Debian.gz"
+);
+
sub run {
my $pkg = shift;
@@ -168,6 +193,43 @@ my @devhelp_links;
# seen files.
my %x11_font_dirs;
+# Check if package is empty
+my $valid_empty = 0;
+foreach (@metapkg_match) {
+ if ($info->field('description') =~ m,($_),) {
+ $valid_empty = 1;
+ last;
+ }
+}
+if ($valid_empty == 0) {
+ foreach my $file (sort keys %{$info->index}) {
+ # Ignore directories
+ unless ($file =~ m,/$,) {
+ # Skip if $file is an empty string
+ next if not $file;
+ # Skip if $file is outside /usr/share/doc/$pkg directory
+ if ($file !~ m,usr/share/doc/($pkg),) {
+ $valid_empty = 0;
+ last;
+ }
+ # Skip if /usr/share/doc/$pkg has files in a subdirectory
+ if ($file =~ m,usr/share/doc/($pkg)/.*/,) {
+ $valid_empty = 0;
+ last;
+ }
+ # Check if files is one of those usually stored in /usr/share/doc/$pkg
+ my $bfile = basename($file);
+ unless (grep (/($bfile)/i, @doc_files)) {
+ $valid_empty = 0;
+ last;
+ }
+ # If everything fails, mark package as candidate to be empty
+ $valid_empty = 1;
+ }
+ }
+ tag 'empty-binary-package' if ($valid_empty);
+}
+
# Read package contents...
foreach my $file (sort keys %{$info->index}) {
next if $file eq "";
diff --git a/checks/files.desc b/checks/files.desc
index 634268f..ad65645 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1132,3 +1132,12 @@ Info: This package contains a directory under <tt>/lib</tt> or
binary package's architecture. This is very likely to be a mistake
when indicating the underlying build system where the files should be
installed.
+
+Tag: empty-binary-package
+Severity: serious
+Certainty: wild-guess
+Info: This binary package appears to be empty, and its description
+ does not mention it is neither meta package or transitional package.
+ .
+ You should check if package is deliberately empty, and then state
+ so in package description, or fix it to provide missing files.
--
Debian package checker
Reply to: