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="\ |
| 21 | ^src/vendorcode/|\ |
| 22 | ^util/kconfig/|\ |
| 23 | \<COPYING\>|\ |
| 24 | \.jpg$|\ |
| 25 | \.cksum$|\ |
| 26 | \.bin$|\ |
| 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-000-license-headers\ |
| 33 | " |
| 34 | |
| 35 | if [ "$HEADER_DIRS" = "" ]; then |
| 36 | HEADER_DIRS="src util" |
| 37 | fi |
| 38 | |
| 39 | LC_ALL=C export LC_ALL |
| 40 | |
| 41 | headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)") |
| 42 | |
| 43 | #check for the old style header |
| 44 | headerlist=$(grep -il "You should have received a copy of the GNU" \ |
| 45 | headerlist 2>/dev/null) |
| 46 | |
| 47 | for file in $headerlist; do |
| 48 | echo "$file has the old GPL header." |
| 49 | done |