blob: fdc76aa543c13e8b931b04d7881e2e564e1551cf [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$|\
28\.hex$|\
29\.patch$|\
30_shipped$|\
31^util/scripts/no-fsf-addresses.sh|\
32^util/lint/lint-000-license-headers|\
Martin Roth69667592016-01-19 21:03:04 -070033^util/lint/lint-stable-009-old-licenses\
Martin Rothda1a70e2016-01-12 15:32:50 -070034"
35
Martin Roth69667592016-01-19 21:03:04 -070036if [ -z "$HEADER_DIRS" ]; then
Martin Rothda1a70e2016-01-12 15:32:50 -070037 HEADER_DIRS="src util"
38fi
39
40LC_ALL=C export LC_ALL
41
42headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
43
44#check for the old style header
45headerlist=$(grep -il "You should have received a copy of the GNU" \
Martin Roth69667592016-01-19 21:03:04 -070046 $headerlist 2>/dev/null)
Martin Rothda1a70e2016-01-12 15:32:50 -070047
48for file in $headerlist; do
49 echo "$file has the old GPL header."
50done