[coreboot-gerrit] New patch to review for coreboot: lint: Check license headers for both paragraphs of the GPL

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Thu Jan 21 22:38:09 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13119

-gerrit

commit 665438e7ed33629ce3796efbfdab025e98e60c8a
Author: Martin Roth <martinroth at google.com>
Date:   Thu Jan 21 13:20:39 2016 -0700

    lint: Check license headers for both paragraphs of the GPL
    
    If the GPLv2 or GPLv2+ license header is being used on a
    coreboot file, make sure it has two paragraphs as specified by
    the Common License Header section in the developer guidelines
    in the coreboot wiki.
    
    Change-Id: Ifffa0fa7272f5a4b129d4b7b8a515f8795bc2401
    Signed-off-by: Martin Roth <martinroth at google.com>
---
 util/lint/lint-000-license-headers | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index ad764b8..2a6a9e9 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -58,11 +58,27 @@ headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
 
 #update headerlist by removing files that match the license string
 check_for_license() {
-	headerlist=$(grep -iL "$1" $headerlist 2>/dev/null)
+	if [ -z "$2" ]; then
+		headerlist=$(grep -iL "$1" $headerlist 2>/dev/null)
+	else
+		local p1list=$(grep -il "$1" $headerlist 2>/dev/null)
+		local p2list=$(grep -il "$2" $headerlist 2>/dev/null)
+
+		# Make list of files that were in both previous lists
+		local pbothlist=$(echo $p1list $p2list | tr ' ' "\n" | \
+			sort | uniq -d)
+
+		# Remove all files that were in both of the previous lists
+		# Note that this is unstable if we ever get any filenames
+		# with spaces.
+		headerlist=$(echo $headerlist $pbothlist | tr ' ' "\n" | \
+			sort | uniq -u)
+	fi
 }
 
 #search the files for license headers
-check_for_license "GNU General Public License"
+check_for_license "under the terms of the GNU General Public License" \
+		"WITHOUT ANY WARRANTY"
 check_for_license 'IS PROVIDED .*"AS IS"'
 check_for_license "IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE"
 check_for_license '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES'



More information about the coreboot-gerrit mailing list