Martin Roth has uploaded this change for review.

View Change

util/lint: Update license header text for SPDX headers.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e
---
M util/lint/lint-000-license-headers
1 file changed, 13 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/36175/1
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index 9b3553b..db4390a 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -62,6 +62,8 @@
cmos\.default\
"

+HEADER_TEXT="license header"
+
#space separated list of directories to test
if [ "$1" = "" ]; then
HEADER_DIRS="src util"
@@ -69,6 +71,11 @@
HEADER_DIRS="$1"
fi

+if [ "$2" = "SPDX_ONLY" ]; then
+SPDX_ONLY=1
+HEADER_TEXT="SPDX identifer"
+fi
+
LC_ALL=C export LC_ALL

#get initial list from git, removing HEADER_EXCLUDED files.
@@ -96,6 +103,10 @@
}

#search the files for license headers
+check_for_license 'SPDX-License-Identifier: *GPL-2.0-or-later'
+check_for_license 'SPDX-License-Identifier: *GPL-2.0-only'
+
+if [ ! "${SPDX_ONLY}" = "1" ]; then
check_for_license "under the terms of the GNU General Public License" \
"WITHOUT ANY WARRANTY"
check_for_license 'IS PROVIDED .*"AS IS"'
@@ -106,13 +117,13 @@
check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE'
check_for_license 'No license required'
check_for_license 'GNU Lesser General Public'
-check_for_license 'SPDX-License-Identifier:.*GPL-2.0-or-later'
+fi

for file in $headerlist; do
# Verify the file exists, and has content that requires a header
# This assumes that a file that has 4 lines or fewer is not notable
# enough to require a license.
if [ -f "$file" ] && [ "$(wc -l < "$file")" -gt 4 ]; then
- echo "$file has no recognized license header."
+ echo "$file has no recognized ${HEADER_TEXT}."
fi
done

To view, visit change 36175. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e
Gerrit-Change-Number: 36175
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth@google.com>
Gerrit-MessageType: newchange