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

[lintian] 01/01: Prevent false positives when checking for missing NOTICE.txt files by looking inside .jar archives. (Closes: #889760)



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

lamby pushed a commit to branch master
in repository lintian.

commit cdd7ce03df65bb0bb4df35ddde89008d0994ca4d
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Feb 6 22:04:21 2018 +0000

    Prevent false positives when checking for missing NOTICE.txt files by looking inside .jar archives. (Closes: #889760)
---
 checks/source-copyright.desc | 2 +-
 checks/source-copyright.pm   | 8 ++++++--
 debian/changelog             | 3 +++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index 313bb1b..c4039e8 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -2,7 +2,7 @@ Check-Script: source-copyright
 Author: Jakub Wilk <jwilk@debian.org>
 Abbrev: scpy
 Type: source
-Needs-Info: unpacked, src-orig-index
+Needs-Info: unpacked, src-orig-index, java-info
 Info: This script checks if a source package conforms to policy
  with regard to copyright files.
  .
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 1a56b03..04619c4 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -161,8 +161,12 @@ sub _check_apache_notice_files {
     return if not @notice_files;
 
     foreach my $binpkg (@procs) {
-        my @files = $binpkg->info->sorted_index;
-        return if any { $_->basename =~ m/^NOTICE(\.txt)?(\.gz)?$/} @files;
+        my @files = map { $_->name } $binpkg->info->sorted_index;
+        my $java_info = $binpkg->info->java_info;
+        for my $jar_file (sort keys %{$java_info}) {
+            push @files, keys %{$java_info->{$jar_file}{files}};
+        }
+        return if any { m{/NOTICE(\.txt)?(\.gz)?$} } @files;
     }
 
     tag 'missing-notice-file-for-apache-license', join(' ', @notice_files);
diff --git a/debian/changelog b/debian/changelog
index 615eb93..6ccb9ec 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,9 @@ lintian (2.5.74) UNRELEASED; urgency=medium
       maintainer-script-should-not-use-recursive-chown-or-chmod tag.
       Heavily based on a patch by Daniel Kahn Gillmor - thanks!
       (Closes: #889489)
+  * checks/source-copyright.pm:
+    + [CL] Prevent false positives when checking for missing NOTICE.txt
+      files by looking inside .jar archives.  (Closes: #889760)
   * checks/systemd.{desc,pm}:
     + [CL] Warn about unit files that install to usual WantedBy= targets.
       Thanks to Sam Morris for the initial patch.  (Closes: #817170)

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


Reply to: