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 |
| 8 | HEADER_EXCLUDED="\ |
Nico Huber | be5492a | 2015-09-29 16:41:19 +0200 | [diff] [blame] | 9 | ^src/lib/gnat/|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 10 | ^src/vendorcode/|\ |
| 11 | ^util/kconfig/|\ |
| 12 | \<COPYING\>|\ |
| 13 | \.jpg$|\ |
| 14 | \.cksum$|\ |
| 15 | \.bin$|\ |
Martin Roth | dea1333 | 2018-05-04 09:19:07 -0600 | [diff] [blame] | 16 | \.vbt$|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 17 | \.hex$|\ |
| 18 | \.patch$|\ |
| 19 | _shipped$|\ |
| 20 | ^util/scripts/no-fsf-addresses.sh|\ |
| 21 | ^util/lint/lint-000-license-headers|\ |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 22 | ^util/lint/lint-stable-009-old-licenses\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 23 | " |
| 24 | |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 25 | if [ -z "$HEADER_DIRS" ]; then |
Jan Dabros | ffa58cf | 2020-07-16 13:38:01 +0200 | [diff] [blame] | 26 | HEADER_DIRS="src util tests" |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 27 | fi |
| 28 | |
| 29 | LC_ALL=C export LC_ALL |
| 30 | |
| 31 | headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)") |
| 32 | |
| 33 | #check for the old style header |
| 34 | headerlist=$(grep -il "You should have received a copy of the GNU" \ |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 35 | $headerlist 2>/dev/null) |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 36 | |
| 37 | for file in $headerlist; do |
| 38 | echo "$file has the old GPL header." |
| 39 | done |