blob: 702798f0cc32c284fe0d121d4333d36628c7a77e [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="\
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
35if [ "$HEADER_DIRS" = "" ]; then
36 HEADER_DIRS="src util"
37fi
38
39LC_ALL=C export LC_ALL
40
41headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
42
43#check for the old style header
44headerlist=$(grep -il "You should have received a copy of the GNU" \
45 headerlist 2>/dev/null)
46
47for file in $headerlist; do
48 echo "$file has the old GPL header."
49done