The following commit has been merged in the master branch:
commit 91691bcc82477a45394e2d801dedce2ed2492f17
Author: Mathieu Parent <[email protected]>
Date:   Thu May 16 16:29:36 2013 +0200

    phppear: Check for binary dependencies
    
    Signed-off-by: Niels Thykier <[email protected]>

diff --git a/checks/phppear.desc b/checks/phppear.desc
index f99552f..7e249b6 100644
--- a/checks/phppear.desc
+++ b/checks/phppear.desc
@@ -2,7 +2,7 @@ Check-Script: phppear
 Author: Mathieu Parent <[email protected]>
 Abbrev: phppear
 Type: source
-Needs-Info: index
+Needs-Info: index, debfiles
 Info: This script checks if the packages comply with various aspects of the
  debian PHP policy.
 
@@ -24,3 +24,8 @@ Info: The package contains an channel.xml file but doesn't 
build-depend on
  pkg-php-tools is the recommended tool for building PEAR and PECL packages. For
  more information, install it and read the included README.Debian.
 
+Tag: pear-package-but-missing-dependency
+Severity: normal
+Certainty: possible
+Info: The package is a PEAR package but its control file doesn't have
+ ${phppear:Debian-Depends} in Depends or ${phppear:Debian-Recommends}.
diff --git a/checks/phppear.pm b/checks/phppear.pm
index 205f18e..e2fb2bc 100644
--- a/checks/phppear.pm
+++ b/checks/phppear.pm
@@ -37,6 +37,22 @@ sub run {
         # Checking source builddep
         if (!$bdepends->implies('pkg-php-tools')) {
             tag 'pear-package-without-pkg-php-tools-builddep';
+        } else {
+            # Checking first binary relations
+            my @binaries = $info->binaries;
+            my $binary = $binaries[0];
+            my $depends = $info->binary_relation($binary, 'depends');
+            my $recommends = $info->binary_relation($binary, 'recommends');
+            my $breaks = $info->binary_relation($binary, 'breaks');
+            if (!$depends->implies('${phppear:Debian-Depends}')) {
+                tag 'pear-package-but-missing-dependency', 'Depends';
+            }
+            if (!$recommends->implies('${phppear:Debian-Recommends}')) {
+                tag 'pear-package-but-missing-dependency', 'Recommends';
+            }
+            if (!$breaks->implies('${phppear:Debian-Breaks}')) {
+                tag 'pear-package-but-missing-dependency', 'Breaks';
+            }
         }
     }
     # PEAR channel

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to