Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Martin Roth | 21c99af | 2016-11-24 13:16:28 -0700 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Martin Roth | 21c99af | 2016-11-24 13:16:28 -0700 | [diff] [blame] | 5 | # DESCR: Check that saved config files are miniconfigs |
| 6 | |
| 7 | LC_ALL=C export LC_ALL |
| 8 | |
| 9 | SYMBOLS='CONFIG_ARCH_\|CONFIG_MAINBOARD_HAS_' |
| 10 | |
| 11 | # 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] | 12 | if [ -n "$(command -v git)" ] && \ |
| 13 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 14 | then |
Martin Roth | 21c99af | 2016-11-24 13:16:28 -0700 | [diff] [blame] | 15 | GREP="git grep -l" |
| 16 | else |
| 17 | GREP="grep -rl" |
| 18 | fi |
| 19 | |
| 20 | #look for a couple of things that should only be set by select keywords |
| 21 | for file in \ |
| 22 | $($GREP "$SYMBOLS" configs) ; do \ |
| 23 | echo "Error: $file seems to be a full config"; \ |
| 24 | done |