[lintian] 01/01: Allow multiple sentence for license problem
This is an automated email from the git hooks/post-receive script.
broucaries-guest pushed a commit to branch master
in repository lintian.
commit 349691afb78741b44f66c4fdf66abc2e3f22c166
Author: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
Date: Sat Jan 23 18:56:52 2016 +0100
Allow multiple sentence for license problem
---
checks/cruft.pm | 18 ++++++++++++++++--
debian/changelog | 1 +
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/checks/cruft.pm b/checks/cruft.pm
index 7a62297..bf0f9ec 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -200,6 +200,11 @@ sub _get_license_check_file {
if(scalar(@keywordlist) < 1) {
fail $syntaxerror, 'No keywords line', $.;
}
+ my @sentencelist = split(/\s*\|\|\s*/, $sentence);
+ if(scalar(@sentencelist) < 1) {
+ fail $syntaxerror, 'No sentence line', $.;
+ }
+
if($regex eq '') {
$regex = '.*';
}
@@ -208,7 +213,7 @@ sub _get_license_check_file {
}
my %ret = (
'keywords' => \@keywordlist,
- 'sentence' => $sentence,
+ 'sentence' => \@sentencelist,
'regex' => qr/$regex/xsm,
'firstregex' => qr/$firstregex/xsm,
);
@@ -1375,7 +1380,16 @@ sub _license_check {
unless(defined($$cleanedblock)) {
$$cleanedblock = _clean_block($block);
}
- unless(index($$cleanedblock,$licenseproblemdata->{'sentence'}) > -1){
+
+ my $foundsentence = 0;
+ my @sentencelist = @{$licenseproblemdata->{'sentence'}};
+ foreach my $sentence (@sentencelist) {
+ if(index($$cleanedblock,$sentence) > -1){
+ $foundsentence = 1;
+ }
+ }
+
+ unless($foundsentence) {
next LICENSE;
}
my $regex
diff --git a/debian/changelog b/debian/changelog
index 9831d9c..35ff841 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ lintian (2.5.41) UNRELEASED; urgency=medium
* checks/cruft.pm:
+ [BR] Check package testsuite for license problems.
+ + [BR] Allow multiple full text for license problems.
* data/spelling/corrections*:
+ [JW] Add more corrections.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: