| 1 | #!/usr/bin/env sh |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
| 5 | # DESCR: Verify that files don't have the old style header |
| 6 | |
| 7 | # regex list of files and directories to exclude from the search |
| 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 | |
| 17 | HEADER_EXCLUDED="\ |
| 18 | ^src/lib/gnat/|\ |
| 19 | ^src/vendorcode/|\ |
| 20 | ^util/kconfig/|\ |
| 21 | \<COPYING\>|\ |
| 22 | \.jpg$|\ |
| 23 | \.cksum$|\ |
| 24 | \.bin$|\ |
| 25 | \.vbt$|\ |
| 26 | \.apcb$|\ |
| 27 | \.hex$|\ |
| 28 | \.patch$|\ |
| 29 | _shipped$|\ |
| 30 | ^util/scripts/no-fsf-addresses.sh|\ |
| 31 | ^util/lint/lint-000-license-headers|\ |
| 32 | ^util/lint/lint-stable-009-old-licenses|\ |
| 33 | ^util/nvidia/cbootimage|\ |
| 34 | ^util/riscv/starfive-jh7110-spl-tool|\ |
| 35 | ^3rdparty|\ |
| 36 | __pycache__|\ |
| 37 | ^payloads/external\ |
| 38 | " |
| 39 | |
| 40 | if [ -z "$HEADER_DIRS" ]; then |
| 41 | HEADER_DIRS="src util tests" |
| 42 | fi |
| 43 | |
| 44 | headerlist=$(${FIND_FILES} $HEADER_DIRS | grep -E -v "($HEADER_EXCLUDED)") |
| 45 | |
| 46 | #check for the old style header |
| 47 | headerlist=$(grep -il "You should have received a copy of the GNU" \ |
| 48 | $headerlist 2>/dev/null) |
| 49 | |
| 50 | for file in $headerlist; do |
| 51 | echo "$file has the old GPL header." |
| 52 | done |