blob: d2aff3a83ae3a6e3adc39139cf6cd5b35dec5aa6 [file] [log] [blame]
Martin Rothda1a70e2016-01-12 15:32:50 -07001#!/bin/sh
Martin Rothda1a70e2016-01-12 15:32:50 -07002#
Patrick Georgi7333a112020-05-08 20:48:04 +02003# SPDX-License-Identifier: GPL-2.0-only
4
Angel Pons04bf41b2020-10-13 01:07:27 +02005# DESCR: Verify that files don't have the old style header
Martin Rothda1a70e2016-01-12 15:32:50 -07006
7# regex list of files and directories to exclude from the search
8HEADER_EXCLUDED="\
Nico Huberbe5492a2015-09-29 16:41:19 +02009^src/lib/gnat/|\
Martin Rothda1a70e2016-01-12 15:32:50 -070010^src/vendorcode/|\
11^util/kconfig/|\
12\<COPYING\>|\
13\.jpg$|\
14\.cksum$|\
15\.bin$|\
Martin Rothdea13332018-05-04 09:19:07 -060016\.vbt$|\
Martin Rothda1a70e2016-01-12 15:32:50 -070017\.hex$|\
18\.patch$|\
19_shipped$|\
20^util/scripts/no-fsf-addresses.sh|\
21^util/lint/lint-000-license-headers|\
Martin Roth69667592016-01-19 21:03:04 -070022^util/lint/lint-stable-009-old-licenses\
Martin Rothda1a70e2016-01-12 15:32:50 -070023"
24
Martin Roth69667592016-01-19 21:03:04 -070025if [ -z "$HEADER_DIRS" ]; then
Jan Dabrosffa58cf2020-07-16 13:38:01 +020026 HEADER_DIRS="src util tests"
Martin Rothda1a70e2016-01-12 15:32:50 -070027fi
28
29LC_ALL=C export LC_ALL
30
31headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
32
33#check for the old style header
34headerlist=$(grep -il "You should have received a copy of the GNU" \
Martin Roth69667592016-01-19 21:03:04 -070035 $headerlist 2>/dev/null)
Martin Rothda1a70e2016-01-12 15:32:50 -070036
37for file in $headerlist; do
38 echo "$file has the old GPL header."
39done