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 9LINTDIR="$( 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 17HEADER_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^3rdparty|\ 35__pycache__|\ 36^payloads/external\ 37" 38 39if [ -z "$HEADER_DIRS" ]; then 40 HEADER_DIRS="src util tests" 41fi 42 43headerlist=$(${FIND_FILES} $HEADER_DIRS | grep -E -v "($HEADER_EXCLUDED)") 44 45#check for the old style header 46headerlist=$(grep -il "You should have received a copy of the GNU" \ 47 $headerlist 2>/dev/null) 48 49for file in $headerlist; do 50 echo "$file has the old GPL header." 51done 52