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

[SCM] Debian package checker branch, master, updated. 2.0.0-67-g6e0646e



The following commit has been merged in the master branch:
commit 6e0646e8308e299105eaf7d50e534bb8cb34ec64
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Fri Nov 28 17:27:05 2008 +0100

    checks/debhelper: Add new tag debhelper-but-no-misc-depends
    
    Warns about missing misc:Depends substvar if you use commands
    that might set it.
    
    Closes: #499737

diff --git a/checks/debhelper b/checks/debhelper
index 59e8745..93186bb 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -35,6 +35,7 @@ use Lintian::Data;
 my $cdbscompat = 5;
 
 my $maint_commands = Lintian::Data->new ('debhelper/maint_commands');
+my $miscDeps_commands = Lintian::Data->new ('debhelper/miscDepends_commands');
 my $dh_commands_depends = Lintian::Data->new ('debhelper/dh_commands', '=');
 
 # The version at which debhelper commands were introduced.  Packages that use
@@ -62,6 +63,7 @@ my $compat = '';
 my $usescdbs = '';
 my $seendhpython = '';
 my $usescdbspython = '';
+my $needmiscdepends = 0;
 my %missingbdeps;
 
 open(RULES, '<', "debfiles/rules") or fail("cannot read debian/rules: $!");
@@ -84,23 +86,28 @@ while (<RULES>) {
 	if ($maint_commands->known($dhcommand) and not m/\s+\-n\s+/) {
 	    $needtomodifyscripts = 1;
 	}
+	if ($miscDeps_commands->known($dhcommand)) {
+	    $needmiscdepends = 1;
+	}
 	if ($dh_commands_depends->known($dhcommand)) {
 	    my $dep = $dh_commands_depends->value($dhcommand);
 	    $missingbdeps{$dep} = $dhcommand;
 	}
-        if ($versions{$dhcommand}) {
-            push (@versioncheck, $dhcommand);
-        }
+	if ($versions{$dhcommand}) {
+	    push (@versioncheck, $dhcommand);
+	}
 	$seencommand = 1;
 	$needbuilddepends = 1;
     } elsif (m,^\s+dh\s+,) {
 	$seencommand = 1;
 	$needbuilddepends = 1;
+	$needmiscdepends = 1;
 	push (@versioncheck, 'dh');
     } elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) {
 	$seencommand = 1;
 	$needbuilddepends = 1;
 	$needtomodifyscripts = 1;
+	$needmiscdepends = 1;
 
 	# CDBS sets DH_COMPAT but doesn't export it.  It does, however, create
 	# a debian/compat file if none was found; that logic is handled later.
@@ -126,6 +133,22 @@ return unless $seencommand;
 my $pkgs = $info->binaries;
 my $single_pkg = keys(%$pkgs) == 1 ? $pkgs->{(keys(%$pkgs))[0]} : '';
 
+for my $binpkg (keys %$pkgs) {
+    my $depends = '';
+    local $/;
+
+    foreach my $field (qw(depends recommends suggests)) {
+	if (open DEPENDS, '<', "control/$binpkg/$field") {
+	    chomp ($depends .= <DEPENDS>);
+	    close(DEPENDS);
+	}
+    }
+
+    tag 'debhelper-but-no-misc-depends', $binpkg
+        if $needmiscdepends and $depends !~ m/\$\{misc:Depends\}/
+	   and $pkgs->{$binpkg} eq 'deb';
+}
+
 # If we got this far, they need to have #DEBHELPER# in their scripts.  Search
 # for scripts that look like maintainer scripts.  Also collect dependency
 # information from debian/control and check compatibility level.
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 811f544..2a00357 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -105,6 +105,16 @@ Info: This package uses dh_python but apparently does not tell it to use
  may mean that the package has not been converted to the current Python
  policy, in which case it probably should be.
 
+Tag: debhelper-but-no-misc-depends
+Type: warning
+Severity: normal
+Certainty: certain
+Ref: debhelper(7)
+Info: The source package uses debhelper but it does not use ${misc:Depends} in
+ the given binary package's debian/control entry.  This is required so the
+ dependencies are set correctly in case the result of a call to any of the dh_
+ commands cause the package to depend on another package.
+
 Tag: missing-build-dependency-for-dh_-command
 Type: error
 Severity: important
diff --git a/debian/changelog b/debian/changelog
index 1c1056f..4e39f47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.1.0) unstable; urgency=low
 
   * Summary of tag changes:
     + Added
+      - debhelper-but-no-misc-depends
       - missing-build-dependency-for-dh_-command
       - quilt-patch-missing-description
       - shlib-calls-exit
@@ -21,6 +22,9 @@ lintian (2.1.0) unstable; urgency=low
     + [FL] Add new tag missing-build-dependency-for-dh_-command for
       debhelper commands that are not from the debhelper package.
       Patch by Raphael Geissert.
+    + [FL] Add new tag debhelper-but-no-misc-depends which warns
+      about missing misc:Depends if you use commands that might
+      set it.  Patch by Raphael Geissert.  (Closes: #499737)
   * checks/fields:
     + [ADB] Ignore non-dependency fields when considering whether a
       versioned dependency is satisfied by the perl core packages.
diff --git a/testset/dh-test/debian/control b/testset/dh-test/debian/control
index febe799..d0890b2 100644
--- a/testset/dh-test/debian/control
+++ b/testset/dh-test/debian/control
@@ -7,6 +7,6 @@ Standards-Version: 3.6.2
 
 Package: dh-test
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}
 Description: <insert up to 60 chars description>
  <insert long description, indented with spaces>
diff --git a/testset/tags.dh-test b/testset/tags.dh-test
index 4e6249c..b4df256 100644
--- a/testset/tags.dh-test
+++ b/testset/tags.dh-test
@@ -4,6 +4,7 @@ E: dh-test: description-is-dh_make-template
 E: dh-test: helper-templates-in-copyright
 E: dh-test: section-is-dh_make-template
 W: dh-test source: ancient-standards-version 3.6.2 (current is 3.8.0)
+W: dh-test source: debhelper-but-no-misc-depends dh-test
 W: dh-test source: debian-rules-ignores-make-clean-error line 48
 W: dh-test source: debian-rules-sets-DH_COMPAT line 12
 W: dh-test source: dh_suidregister-is-obsolete

-- 
Debian package checker


Reply to: