Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Angel Pons | 04bf41b | 2020-10-13 01:07:27 +0200 | [diff] [blame] | 5 | # DESCR: Verify that files don't have the old style header |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 6 | |
| 7 | # regex list of files and directories to exclude from the search |
Martin Roth | d81debd | 2022-06-03 00:06:57 -0600 | [diff] [blame] | 8 | |
| 9 | LINTDIR="$( |
| 10 | cd -- "$(dirname "$0")" > /dev/null 2>&1 || return |
| 11 | pwd -P |
| 12 | )" |
| 13 | |
| 14 | # shellcheck source=helper_functions.sh |
| 15 | . "${LINTDIR}/helper_functions.sh" |
| 16 | |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 17 | HEADER_EXCLUDED="\ |
Nico Huber | be5492a | 2015-09-29 16:41:19 +0200 | [diff] [blame] | 18 | ^src/lib/gnat/|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 19 | ^src/vendorcode/|\ |
| 20 | ^util/kconfig/|\ |
| 21 | \<COPYING\>|\ |
| 22 | \.jpg$|\ |
| 23 | \.cksum$|\ |
| 24 | \.bin$|\ |
Martin Roth | dea1333 | 2018-05-04 09:19:07 -0600 | [diff] [blame] | 25 | \.vbt$|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 26 | \.hex$|\ |
| 27 | \.patch$|\ |
| 28 | _shipped$|\ |
| 29 | ^util/scripts/no-fsf-addresses.sh|\ |
| 30 | ^util/lint/lint-000-license-headers|\ |
Martin Roth | 95b5b02 | 2022-10-17 07:53:16 -0600 | [diff] [blame] | 31 | ^util/lint/lint-stable-009-old-licenses|\ |
| 32 | ^util/nvidia/cbootimage|\ |
| 33 | ^3rdparty|\ |
| 34 | __pycache__|\ |
| 35 | ^payloads/external\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 36 | " |
| 37 | |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 38 | if [ -z "$HEADER_DIRS" ]; then |
Jan Dabros | ffa58cf | 2020-07-16 13:38:01 +0200 | [diff] [blame] | 39 | HEADER_DIRS="src util tests" |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 40 | fi |
| 41 | |
Felix Singer | 74b4bd0 | 2023-04-01 14:42:54 +0200 | [diff] [blame] | 42 | headerlist=$(${FIND_FILES} $HEADER_DIRS | grep -E -v "($HEADER_EXCLUDED)") |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 43 | |
| 44 | #check for the old style header |
| 45 | headerlist=$(grep -il "You should have received a copy of the GNU" \ |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 46 | $headerlist 2>/dev/null) |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 47 | |
| 48 | for file in $headerlist; do |
| 49 | echo "$file has the old GPL header." |
| 50 | done |