blob: 6e6dc1cb6161774ddb9209619e0c551f93b26d08 [file] [log] [blame]
Martin Rothda1a70e2016-01-12 15:32:50 -07001#!/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
20HEADER_EXCLUDED="\
Nico Huberbe5492a2015-09-29 16:41:19 +020021^src/lib/gnat/|\
Martin Rothda1a70e2016-01-12 15:32:50 -070022^src/vendorcode/|\
23^util/kconfig/|\
24\<COPYING\>|\
25\.jpg$|\
26\.cksum$|\
27\.bin$|\
Martin Rothdea13332018-05-04 09:19:07 -060028\.vbt$|\
Martin Rothda1a70e2016-01-12 15:32:50 -070029\.hex$|\
30\.patch$|\
31_shipped$|\
32^util/scripts/no-fsf-addresses.sh|\
33^util/lint/lint-000-license-headers|\
Martin Roth69667592016-01-19 21:03:04 -070034^util/lint/lint-stable-009-old-licenses\
Martin Rothda1a70e2016-01-12 15:32:50 -070035"
36
Martin Roth69667592016-01-19 21:03:04 -070037if [ -z "$HEADER_DIRS" ]; then
Martin Rothda1a70e2016-01-12 15:32:50 -070038 HEADER_DIRS="src util"
39fi
40
41LC_ALL=C export LC_ALL
42
43headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
44
45#check for the old style header
46headerlist=$(grep -il "You should have received a copy of the GNU" \
Martin Roth69667592016-01-19 21:03:04 -070047 $headerlist 2>/dev/null)
Martin Rothda1a70e2016-01-12 15:32:50 -070048
49for file in $headerlist; do
50 echo "$file has the old GPL header."
51done