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

[SCM] Debian package checker branch, master, updated. 2.1.6-39-g33c0632



The following commit has been merged in the master branch:
commit 1edd0d34d8477360de0fe8444666e911d07ae6e0
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Mon Jan 19 20:56:30 2009 -0600

    Warn of ${misc:Depends} in recommends and suggests
    
    Check for ${misc:Depends} again in suggests and recommends, but emit
    weak-dependency-on-misc-depends in that case.
    
    Signed-off-by: Raphael Geissert <atomo64@gmail.com>

diff --git a/checks/debhelper b/checks/debhelper
index 7fe7088..5ac54f4 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -143,18 +143,29 @@ my $pkgs = $info->binaries;
 my $single_pkg = keys(%$pkgs) == 1 ? $pkgs->{(keys(%$pkgs))[0]} : '';
 
 for my $binpkg (keys %$pkgs) {
-    my $depends = '';
+    my ($weak_depends, $strong_depends, $depends) = ('','','');
     local $/;
 
-    foreach my $field (qw(pre-depends depends recommends)) {
+    foreach my $field (qw(pre-depends depends)) {
 	if (open DEPENDS, '<', "control/$binpkg/$field") {
-	    chomp ($depends .= <DEPENDS>);
+	    chomp ($strong_depends .= <DEPENDS>);
 	    close(DEPENDS);
 	}
     }
+    foreach my $field (qw(recommends suggests)) {
+	if (open DEPENDS, '<', "control/$binpkg/$field") {
+	    chomp ($weak_depends .= <DEPENDS>);
+	    close(DEPENDS);
+	}
+    }
+    $depends = $weak_depends . $strong_depends;
 
     tag 'debhelper-but-no-misc-depends', $binpkg
-        if $needmiscdepends and $depends !~ m/\$\{misc:Depends\}/
+	if $needmiscdepends and $depends !~ m/\$\{misc:Depends\}/
+	   and $pkgs->{$binpkg} eq 'deb';
+
+    tag 'weak-dependency-on-misc-depends', $binpkg
+	if $weak_depends =~ m/\$\{misc:Depends\}/
 	   and $pkgs->{$binpkg} eq 'deb';
 }
 
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 72f02c6..9f42dfa 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -151,3 +151,12 @@ Info: This debhelper config file appears to use shell brace expansion
  to an accident of implementation but is not a supported feature.  Only
  <tt>?</tt>, <tt>*</tt>, and <tt>[...]</tt> are supported.
 Ref: debhelper(1)
+
+Tag: weak-dependency-on-misc-depends
+Severity: normal
+Certainty: possible
+Ref: debhelper(7)
+Info: The source package declares a weak dependecy on ${misc:Depends} in
+ the given binary package's debian/control entry.  A stronger dependency, that
+ is one that ensures the package's installation, is required so that the
+ additional commands are available to the maintainer scripts when they are run.
diff --git a/t/tests/debhelper-no-depends/debian/debian/control.in b/t/tests/debhelper-no-depends/debian/debian/control.in
index 32a68ca..4c9af3e 100644
--- a/t/tests/debhelper-no-depends/debian/debian/control.in
+++ b/t/tests/debhelper-no-depends/debian/debian/control.in
@@ -10,3 +10,21 @@ Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.
+
+Package: debhelper-pre-depends
+Architecture: {$architecture}
+Pre-Depends: $\{misc:Depends\}
+Description: {$description} extra string
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string to not to trigger duplicated description tags.
+
+Package: debhelper-suggests
+Architecture: {$architecture}
+Suggests: $\{misc:Depends\}
+Description: {$description} another extra string
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string.
diff --git a/t/tests/debhelper-no-depends/desc b/t/tests/debhelper-no-depends/desc
index 9cbc738..c028389 100644
--- a/t/tests/debhelper-no-depends/desc
+++ b/t/tests/debhelper-no-depends/desc
@@ -7,3 +7,4 @@ Test-For:
  missing-build-dependency-for-dh_-command
  package-lacks-versioned-build-depends-on-debhelper
  package-uses-debhelper-but-lacks-build-depends
+ weak-dependency-on-misc-depends
diff --git a/t/tests/debhelper-no-depends/tags b/t/tests/debhelper-no-depends/tags
index 344eb61..3b42b9d 100644
--- a/t/tests/debhelper-no-depends/tags
+++ b/t/tests/debhelper-no-depends/tags
@@ -4,3 +4,4 @@ E: debhelper-no-depends source: missing-build-dependency-for-dh_-command dh_lisp
 E: debhelper-no-depends source: package-uses-debhelper-but-lacks-build-depends
 W: debhelper-no-depends source: debhelper-but-no-misc-depends debhelper-no-depends
 W: debhelper-no-depends source: package-lacks-versioned-build-depends-on-debhelper 7
+W: debhelper-no-depends source: weak-dependency-on-misc-depends debhelper-suggests

-- 
Debian package checker


Reply to: