Martin Roth | 21c99af | 2016-11-24 13:16:28 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2016 Google Inc. |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; version 2 of the License. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # DESCR: Check that saved config files are miniconfigs |
| 16 | |
| 17 | LC_ALL=C export LC_ALL |
| 18 | |
| 19 | SYMBOLS='CONFIG_ARCH_\|CONFIG_MAINBOARD_HAS_' |
| 20 | |
| 21 | # Use git grep if the code is in a git repo, otherwise use grep. |
Alex Thiessen | 73f19dc | 2018-01-16 23:05:48 +0000 | [diff] [blame] | 22 | if [ -n "$(command -v git)" ] && \ |
| 23 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 24 | then |
Martin Roth | 21c99af | 2016-11-24 13:16:28 -0700 | [diff] [blame] | 25 | GREP="git grep -l" |
| 26 | else |
| 27 | GREP="grep -rl" |
| 28 | fi |
| 29 | |
| 30 | #look for a couple of things that should only be set by select keywords |
| 31 | for file in \ |
| 32 | $($GREP "$SYMBOLS" configs) ; do \ |
| 33 | echo "Error: $file seems to be a full config"; \ |
| 34 | done |