[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 879623d2eb8edaf27f03a1970ba03fe71fbbbc36
Author: Mathieu Parent <math.parent@gmail.com>
Date:   Thu May 16 15:24:51 2013 +0200

    Initial phppear check
    
    Check for package.xml and package2.xml
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/phppear.desc b/checks/phppear.desc
new file mode 100644
index 0000000..db27cac
--- /dev/null
+++ b/checks/phppear.desc
@@ -0,0 +1,17 @@
+Check-Script: phppear
+Author: Mathieu Parent <sathieu@debian.org>
+Abbrev: phppear
+Type: source
+Needs-Info: index
+Info: This script checks if the packages comply with various aspects of the
+ debian PHP policy.
+
+Tag: pear-package-without-pkg-php-tools-builddep
+Severity: normal
+Certainty: possible
+Info: The package contains an package.xml or package2.xml file but doesn't
+ build-depend on pkg-php-tools.
+ .
+ pkg-php-tools is the recommended tool for building PEAR and PECL packages. For
+ more information, install it and read the included README.Debian.
+
diff --git a/t/scripts/check-load.t b/checks/phppear.pm
old mode 100755
new mode 100644
similarity index 55%
copy from t/scripts/check-load.t
copy to checks/phppear.pm
index 9d14a4e..bbef200
--- a/t/scripts/check-load.t
+++ b/checks/phppear.pm
@@ -1,6 +1,6 @@
-#!/usr/bin/perl
+# phppear -- lintian check script -*- perl -*-
 
-# Copyright (C) 2012 Niels Thykier
+# Copyright (C) 2013 Mathieu Parent <math.parent@gmail.com>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,26 +18,28 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 # MA 02110-1301, USA.
 
+package Lintian::phppear;
+
 use strict;
 use warnings;
 
-use Test::More import => ['done_testing'];
-
-use Test::Lintian;
-
-# Test that all checks can be loaded (except lintian.desc, which is
-# a special case).
-sub accept_filter {
-    return !m,/lintian\.desc$,;
+use Lintian::Tags qw(tag);
+use Lintian::Relation;
+
+sub run {
+    my ($pkg, $type, $info) = @_;
+
+    # PEAR or PECL package
+    my $package_xml = $info->index('package.xml');
+    my $package2_xml = $info->index('package2.xml');
+    if (defined($package_xml) || defined($package2_xml)) {
+        # Checking source builddep
+        my $bdepends = $info->relation('build-depends');
+        if (!$bdepends->implies('pkg-php-tools')) {
+            tag 'pear-package-without-pkg-php-tools-builddep';
+        }
+    }
+    return;
 }
 
-my $opts = {
-    'filter' => \&accept_filter,
-};
-
-$ENV{'LINTIAN_ROOT'} //= '.';
-
-test_load_checks ($opts, "$ENV{'LINTIAN_ROOT'}/checks");
-
-done_testing;
-
+1;
diff --git a/profiles/debian/main.profile b/profiles/debian/main.profile
index 40c26aa..3a84eaf 100644
--- a/profiles/debian/main.profile
+++ b/profiles/debian/main.profile
@@ -6,7 +6,7 @@ Enable-Tags-From-Check: apache2, binaries, changelog-file, changes-file, conffil
  debhelper, debian-readme, debian-source-dir, description, duplicate-files,
  fields, filename-length, files, group-checks, huge-usr-share, infofiles, init.d,
  java, lintian, manpages, md5sums, menu-format, menus, nmu, ocaml, patch-systems,
- po-debconf, rules, scripts, shared-libs, source-copyright, standards-version,
- symlinks, systemd, testsuite, version-substvars, watch-file
+ phppear, po-debconf, rules, scripts, shared-libs, source-copyright,
+ standards-version, symlinks, systemd, testsuite, version-substvars, watch-file
 Disable-Tags: hardening-no-stackprotector
 

-- 
Debian package checker


Reply to: