aboutsummaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-01-12 15:32:50 -0700
committerMartin Roth <martinroth@google.com>2016-01-15 04:58:16 +0100
commitda1a70ea032a1bbb3bb973115a9d4c6f85708b33 (patch)
treecbd0941717b58e25ce62b68b7a3bd2d9b8198962 /util/lint
parent9df9e939146f6b715947754eb10c8d96ab7c5873 (diff)
util/lint: Add linter for files with the old license header
Help prevent additional files coming in to the tree with the old license header. Change-Id: Idbafc2d8c05f87075083293d27900304c53e13dc Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/12920 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/lint-stable-009-old-licenses49
1 files changed, 49 insertions, 0 deletions
diff --git a/util/lint/lint-stable-009-old-licenses b/util/lint/lint-stable-009-old-licenses
new file mode 100755
index 0000000000..702798f0cc
--- /dev/null
+++ b/util/lint/lint-stable-009-old-licenses
@@ -0,0 +1,49 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2010 coresystems GmbH
+# Copyright (C) 2016 Google Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+#
+# DESCR: verify that files don't have the old style header
+
+# regex list of files and directories to exclude from the search
+HEADER_EXCLUDED="\
+^src/vendorcode/|\
+^util/kconfig/|\
+\<COPYING\>|\
+\.jpg$|\
+\.cksum$|\
+\.bin$|\
+\.hex$|\
+\.patch$|\
+_shipped$|\
+^util/scripts/no-fsf-addresses.sh|\
+^util/lint/lint-000-license-headers|\
+^util/lint/lint-stable-000-license-headers\
+"
+
+if [ "$HEADER_DIRS" = "" ]; then
+ HEADER_DIRS="src util"
+fi
+
+LC_ALL=C export LC_ALL
+
+headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
+
+#check for the old style header
+headerlist=$(grep -il "You should have received a copy of the GNU" \
+ headerlist 2>/dev/null)
+
+for file in $headerlist; do
+ echo "$file has the old GPL header."
+done