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

[lintian] 01/01: Do not emit "license-problem-php-license" when the source comes from pecl.php.net: "The last agreement with FTP Masters was that PHP license is OK when the sources some from PECL repository." (Closes: #810780)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 87ea6311efd38fbd01c5a43b87d5d05b435e692c
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jan 23 17:06:18 2018 +1100

    Do not emit "license-problem-php-license" when the source comes from pecl.php.net: "The last agreement with FTP Masters was that PHP license is OK when the sources some from PECL repository." (Closes: #810780)
---
 checks/cruft.desc |  3 +++
 checks/cruft.pm   | 63 +++++++++++++++++++++++++++++++------------------------
 debian/changelog  |  5 +++++
 3 files changed, 44 insertions(+), 27 deletions(-)

diff --git a/checks/cruft.desc b/checks/cruft.desc
index 91753bb..59e7de8 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -629,6 +629,9 @@ Certainty: possible
 Info: This package appears to be covered by version 3.0 (exactly) of the
  PHP license.  This license is not applicable to anything that is not PHP
  and has no contributions from the PHP Group.
+ .
+ This tag is not emitted for packages from pecl.php.net as determined by
+ the <tt>Source:</tt> header in <tt>debian/copyright</tt>.
 Ref: https://ftp-master.debian.org/REJECT-FAQ.html
 
 Tag: license-problem-gfdl-invariants
diff --git a/checks/cruft.pm b/checks/cruft.pm
index cad619d..03d616d 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -930,11 +930,11 @@ sub full_text_check {
         # permission to distribute those.
         if(
             _license_check(
-                $source_pkg, $name,
-                $basename,$NON_DISTRIBUTABLE_LICENSES,
-                $block,$blocknumber,
-                \$cleanedblock,\%matchedkeyword,
-                \%licenseproblemhash
+                $info, $source_pkg,
+                $name,$basename,
+                $NON_DISTRIBUTABLE_LICENSES,$block,
+                $blocknumber,\$cleanedblock,
+                \%matchedkeyword,\%licenseproblemhash
             )
           ){
             return;
@@ -947,9 +947,10 @@ sub full_text_check {
         }
 
         _license_check(
-            $source_pkg, $name, $basename,
-            $NON_FREE_LICENSES,$block,  $blocknumber,
-            \$cleanedblock, \%matchedkeyword,\%licenseproblemhash
+            $info, $source_pkg, $name,
+            $basename,$NON_FREE_LICENSES,$block,
+            $blocknumber,\$cleanedblock, \%matchedkeyword,
+            \%licenseproblemhash
         );
 
         # check only in block 0
@@ -1163,10 +1164,10 @@ sub _tag_gfdl {
 # return True in case of license problem
 sub _check_gfdl_license_problem {
     my (
-        $source_pkg, $name,$basename,
-        $block,$blocknumber,$cleanedblock,
-        $matchedkeyword,$licenseproblemhash,$licenseproblem,
-        %matchedhash
+        $info, $source_pkg, $name,
+        $basename,$block,$blocknumber,
+        $cleanedblock,$matchedkeyword,$licenseproblemhash,
+        $licenseproblem,%matchedhash
     )= @_;
     my $rawgfdlsections  = $matchedhash{rawgfdlsections}  || '';
     my $rawcontextbefore = $matchedhash{rawcontextbefore} || '';
@@ -1276,10 +1277,10 @@ sub _check_gfdl_license_problem {
 # whitelist good rfc
 sub _rfc_whitelist_filename {
     my (
-        $source_pkg, $name, $basename,
-        $block,$blocknumber, $cleanedblock,
-        $matchedkeyword,$licenseproblemhash, $licenseproblem,
-        %matchedhash
+        $info, $source_pkg, $name,
+        $basename,$block,$blocknumber,
+        $cleanedblock,$matchedkeyword,$licenseproblemhash,
+        $licenseproblem,%matchedhash
     )= @_;
     return 0 if $name eq 'debian/copyright';
     my $lcname = lc($basename);
@@ -1297,12 +1298,19 @@ sub _rfc_whitelist_filename {
 # whitelist php source
 sub _php_source_whitelist {
     my (
-        $source_pkg, $name, $basename,
-        $block,$blocknumber, $cleanedblock,
-        $matchedkeyword,$licenseproblemhash, $licenseproblem,
-        %matchedhash
+        $info, $source_pkg, $name,
+        $basename,$block,$blocknumber,
+        $cleanedblock,$matchedkeyword,$licenseproblemhash,
+        $licenseproblem,%matchedhash
     )= @_;
 
+    my $copyright_path = $info->index_resolved_path('debian/copyright');
+    if (    $copyright_path
+        and $copyright_path->file_contents
+        =~ m{^Source: https?://pecl.php.net/package/.*$}m) {
+        return 0;
+    }
+
     if($source_pkg =~ m,^php\d*(?:\.\d+)?$,xms) {
         return 0;
     }
@@ -1460,9 +1468,10 @@ sub _md5sum_based_check {
 # check bad license
 sub _license_check {
     my (
-        $source_pkg, $name, $basename,
-        $licensesdatas, $block, $blocknumber,
-        $cleanedblock,$matchedkeyword, $licenseproblemhash
+        $info, $source_pkg, $name,
+        $basename,$licensesdatas, $block,
+        $blocknumber,$cleanedblock,$matchedkeyword,
+        $licenseproblemhash
     )= @_;
     my $ret = 0;
 
@@ -1517,10 +1526,10 @@ sub _license_check {
 
         if(defined($licenseproblemdata->{'callsub'})) {
             my $subresult= $licenseproblemdata->{'callsub'}->(
-                $source_pkg, $name, $basename,
-                $block,$blocknumber,$cleanedblock,
-                $matchedkeyword,$licenseproblemhash,$licenseproblem,
-                %+
+                $info, $source_pkg, $name,
+                $basename,$block,$blocknumber,
+                $cleanedblock,$matchedkeyword,$licenseproblemhash,
+                $licenseproblem,%+
             );
             if($subresult) {
                 $licenseproblemhash->{$licenseproblem} = 1;
diff --git a/debian/changelog b/debian/changelog
index 313e8f1..6409e06 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,11 @@ lintian (2.5.72) UNRELEASED; urgency=medium
     + [CL] Avoid a false positive for spelling-error-in-binary that was
       causing a FTBFS on armhf.  (Closes: #888074)
     + [CL] Drop a duplicate line in spelling-error-in-binary exceptions.
+  * checks/cruft.{desc,pm}:
+    + [CL] Do not emit "license-problem-php-license" when the source comes
+      from pecl.php.net: "The last agreement with FTP Masters was that PHP
+      license is OK when the sources some from PECL repository."
+      (Closes: #810780)
   * checks/debhelper.{desc,pm}:
     + [CL] Warn about packages that use about dh_systemd_enable or
       dh_systemd_start overrides whilst using debhelper compat level 11 as

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: