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

[SCM] Debian package checker branch, master, updated. 2.5.14-57-gbfd87c2



The following commit has been merged in the master branch:
commit bf8ce9c3b4c5f7d3cdb634e070893a6ea34b69c0
Author: Mathieu Parent <math.parent@gmail.com>
Date:   Mon May 27 12:14:34 2013 +0200

    PECL support requires pkg-php-tools (>= 1.5~)
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/phppear.desc b/checks/phppear.desc
index 1f0f891..47cef38 100644
--- a/checks/phppear.desc
+++ b/checks/phppear.desc
@@ -2,7 +2,7 @@ Check-Script: phppear
 Author: Mathieu Parent <sathieu@debian.org>
 Abbrev: phppear
 Type: source
-Needs-Info: index, debfiles
+Needs-Info: index, debfiles, unpacked
 Info: This script checks if the packages comply with various aspects of the
  debian PHP policy.
 
diff --git a/checks/phppear.pm b/checks/phppear.pm
index 5203c5e..1bbb079 100644
--- a/checks/phppear.pm
+++ b/checks/phppear.pm
@@ -23,6 +23,8 @@ package Lintian::phppear;
 use strict;
 use warnings;
 
+use autodie;
+
 use Lintian::Tags qw(tag);
 use Lintian::Relation;
 
@@ -70,6 +72,29 @@ sub run {
                 '(>= 1.4~)', 'for package2.xml';
         }
     }
+
+    if (defined($package_xml) && $package_xml->is_regular_file) {
+        # Wild guess package type as in PEAR_PackageFile_v2::getPackageType()
+        my $package_type = 'unknown';
+        open(my $package_xml_fd, '<', $info->unpacked($package_xml));
+        while (<$package_xml_fd>) {
+            if (/^\s*<(php|extsrc|extbin|zendextsrc|zendextbin)release\s*\/?>/ ){
+                $package_type = $1;
+                last;
+            }
+            if (/^\s*<bundle\s*\/?>/ ){
+                $package_type = 'bundle';
+                last;
+            }
+        }
+        close($package_xml_fd);
+        if ($package_type eq 'extsrc') { # PECL package
+            if (!$bdepends->implies('pkg-php-tools (>= 1.5~)')) {
+                tag 'pear-package-feature-requires-newer-pkg-php-tools',
+                    '(>= 1.5~)', 'for PECL support';
+            }
+        }
+    }
     # PEAR channel
     my $channel_xml = $info->index('channel.xml');
     if (defined($channel_xml)) {

-- 
Debian package checker


Reply to: