Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2010 coresystems GmbH |
| 5 | # Copyright (C) 2016 Google Inc. |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; version 2 of the License. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # |
| 17 | # DESCR: verify that files don't have the old style header |
| 18 | |
| 19 | # regex list of files and directories to exclude from the search |
| 20 | HEADER_EXCLUDED="\ |
Nico Huber | be5492a | 2015-09-29 16:41:19 +0200 | [diff] [blame] | 21 | ^src/lib/gnat/|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 22 | ^src/vendorcode/|\ |
| 23 | ^util/kconfig/|\ |
| 24 | \<COPYING\>|\ |
| 25 | \.jpg$|\ |
| 26 | \.cksum$|\ |
| 27 | \.bin$|\ |
Martin Roth | dea1333 | 2018-05-04 09:19:07 -0600 | [diff] [blame] | 28 | \.vbt$|\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 29 | \.hex$|\ |
| 30 | \.patch$|\ |
| 31 | _shipped$|\ |
| 32 | ^util/scripts/no-fsf-addresses.sh|\ |
| 33 | ^util/lint/lint-000-license-headers|\ |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 34 | ^util/lint/lint-stable-009-old-licenses\ |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 35 | " |
| 36 | |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 37 | if [ -z "$HEADER_DIRS" ]; then |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 38 | HEADER_DIRS="src util" |
| 39 | fi |
| 40 | |
| 41 | LC_ALL=C export LC_ALL |
| 42 | |
| 43 | headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)") |
| 44 | |
| 45 | #check for the old style header |
| 46 | headerlist=$(grep -il "You should have received a copy of the GNU" \ |
Martin Roth | 6966759 | 2016-01-19 21:03:04 -0700 | [diff] [blame] | 47 | $headerlist 2>/dev/null) |
Martin Roth | da1a70e | 2016-01-12 15:32:50 -0700 | [diff] [blame] | 48 | |
| 49 | for file in $headerlist; do |
| 50 | echo "$file has the old GPL header." |
| 51 | done |