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

[lintian] 01/05: Push exception to license check to licensecheck function.



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

broucaries-guest pushed a commit to branch master
in repository lintian.

commit 3818eb2080066d2f26e4c2c4d0588a7ce2ed0b97
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Sat Jan 4 23:01:20 2014 +0100

    Push exception to license check to licensecheck function.
    
    Simplify the code.
    
    Signed-off-by: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
---
 checks/cruft.pm | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/checks/cruft.pm b/checks/cruft.pm
index 7b516de..41d87fd 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -506,23 +506,7 @@ sub find_cruft {
             }
             close($fd);
         }
-
-        # license string in debian/changelog are probably just changes
-        next ENTRY
-          if $name eq 'debian/changelog';
-
-        # Ignore these strings in d/README.{Debian,source}.  If they
-        # appear there it is probably just "file XXX got removed
-        # because of license Y".
-        next ENTRY
-          if $name eq 'debian/README.Debian'
-          or $name eq 'debian/README.source';
-
-        $path = $info->unpacked($entry);
-
-        # test license problem is source file (only text file)
-        next ENTRY unless -T $path;
-        license_check($info, $name, $path);
+        license_check($info, $name, $info->unpacked($entry));
     }
     return;
 }
@@ -533,6 +517,21 @@ sub find_cruft {
 sub license_check {
     my ($info, $name, $path) = @_;
 
+    # license string in debian/changelog are probably just change
+    # Ignore these strings in d/README.{Debian,source}.  If they
+    # appear there it is probably just "file XXX got removed
+    # because of license Y".
+    if (   $name eq 'debian/changelog'
+        or $name eq 'debian/README.Debian'
+        or $name eq 'debian/README.source') {
+        return;
+    }
+
+    # allow to check only text file
+    unless(-T $path) {
+        return;
+    }
+
     my $sfd = Lintian::SlidingWindow->new('<', $path, sub { $_ = lc($_); });
     my %licenseproblemhash = ();
 

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


Reply to: