summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2019-09-23 18:14:34 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-01-02 14:48:48 +0000
commite348eba64198ec3c57ee1fb32a6f5931737d3a4b (patch)
tree185797ecfed0114d16177212884aabf666fbe25d
parentff081888394489a99b1cce87a2ca6ab989c8500f (diff)
downloadcoreboot-e348eba64198ec3c57ee1fb32a6f5931737d3a4b.tar.xz
util/lint: Update license header text for SPDX headers.
In preparation to update to SPDX license headers, add identifiers for the licenses seen in the coreboot project and create a command line parameter allowing only SPDX license identifiers to be detected. Here are example locations of these licenses: Apache-2.0 - src/soc/sifive BSD-3-Clause - Throughout coreboot & libpayload source GPL-2.0-only - Throughout coreboot source GPL-2.0-or-later - Throughout coreboot source GPL-3.0-only - util/amdtools GPL-3.0-or-later - src/lib/[gcov/libgcov/gnat] ISC - src/lib/ubsan.c, soc/qualcomm/ipq806x/include/soc/gsbi.h, others MIT - soc/nvidia/tegra210/mipi_dsi.c, files in mainboard/cavium/ X11 - include/device/drm_dp_helper.h, drivers/aspeed/common/ast_tables.h Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: I07a7ca408ac8563e03e189d05ef7729dfb6fc24e Reviewed-on: https://review.coreboot.org/c/coreboot/+/36175 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
-rwxr-xr-xutil/lint/lint-000-license-headers22
1 files changed, 20 insertions, 2 deletions
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index 9b3553b4a4..88e15ecca0 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -62,6 +62,8 @@ cmos\.layout|\
cmos\.default\
"
+HEADER_TEXT="license header"
+
#space separated list of directories to test
if [ "$1" = "" ]; then
HEADER_DIRS="src util"
@@ -69,6 +71,11 @@ else
HEADER_DIRS="$1"
fi
+if [ "$2" = "SPDX_ONLY" ]; then
+ SPDX_ONLY=1
+ HEADER_TEXT="SPDX identifier"
+fi
+
LC_ALL=C export LC_ALL
#get initial list from git, removing HEADER_EXCLUDED files.
@@ -96,6 +103,17 @@ check_for_license() {
}
#search the files for license headers
+check_for_license 'SPDX-License-Identifier: Apache-2.0'
+check_for_license 'SPDX-License-Identifier: BSD-3-Clause'
+check_for_license 'SPDX-License-Identifier: GPL-2.0-only'
+check_for_license 'SPDX-License-Identifier: GPL-2.0-or-later'
+check_for_license 'SPDX-License-Identifier: GPL-3.0-only'
+check_for_license 'SPDX-License-Identifier: GPL-3.0-or-later'
+check_for_license 'SPDX-License-Identifier: ISC'
+check_for_license 'SPDX-License-Identifier: MIT'
+check_for_license 'SPDX-License-Identifier: X11'
+
+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 +124,13 @@ check_for_license 'assumes any liability or responsibility for the use'
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