[PATCH 4/4] a bunch more license false positives

Philip Hands phil at hands.com
Mon Jan 14 11:49:16 UTC 2013


---
 scripts/licensecheck.pl |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 3ea562f..36dd3fd 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -329,12 +329,19 @@ sub parse_copyright {
 	)';
     my $copyright_disindicator_regex = '
 	\b(?:info(?:rmation)?	# Discussing copyright information
-	|notice			# Discussing the notice
+	|notices?,?		# Discussing the notice
 	|and|or                 # Part of a sentence
-	|(holder|owner)s?.*contributors?  # Part of a sentence
+	|(holder|owner)s?       # Part of a sentence
+	|ownership              # Part of a sentence
+	|string\s(to\sbe\s)?accessable     # Part of a sentence
+	|string\sin\sthe\sexecutable     # Part of a sentence
+	|material               # Part of a sentence
+	|claims?                # Part of a sentence
+	|to\sthis               # Part of a sentence
+	|issues?,?		# Part of a sentence
 	)\b';
     my $copyright_predisindicator_regex = '(
-    ^[#]define\s+\w+\(c\)    # #define foo(c) -- not copyright
+    ^[#]define\s+.*\(c\)    # #define foo(c) -- not copyright
 	)';
 
     if ( ! m%$copyright_predisindicator_regex%ix) {
@@ -365,7 +372,7 @@ sub clean_comments {
     # regular comment pattern and trim it. Fall back to old algorithm
     # if no such pattern found.
     if( 4 <= scalar(()=m{ ^\s*
-                           ([^a-zA-Z0-9\s]{1,3})
+                           ([^a-zA-Z0-9\s=-]{1,3})
                            \s\w
                        }xmg)
     ){
@@ -474,7 +481,7 @@ sub parselicense {
 	$license = "GPL$gplver$extrainfo $license";
     }
 
-    if ($licensetext =~ /is distributed.*terms.*GPL/) {
+    if ($licensetext =~ /is distributed.*\bterms.*\bGPL/) {
 	$license = "GPL (unversioned/unknown version) $license";
     }
 
-- 
1.7.10.4




More information about the devscripts-devel mailing list