blob: 4f298508cea24110bcf26e4a860b21ea2e9bc4f5 [file] [log] [blame]
Martin Roth21c99af2016-11-24 13:16:28 -07001#!/bin/sh
Martin Roth21c99af2016-11-24 13:16:28 -07002#
Patrick Georgi7333a112020-05-08 20:48:04 +02003# SPDX-License-Identifier: GPL-2.0-only
4
Martin Roth21c99af2016-11-24 13:16:28 -07005# DESCR: Check that saved config files are miniconfigs
6
7LC_ALL=C export LC_ALL
8
9SYMBOLS='CONFIG_ARCH_\|CONFIG_MAINBOARD_HAS_'
10
11# Use git grep if the code is in a git repo, otherwise use grep.
Alex Thiessen73f19dc2018-01-16 23:05:48 +000012if [ -n "$(command -v git)" ] && \
13 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
14then
Martin Roth21c99af2016-11-24 13:16:28 -070015 GREP="git grep -l"
16else
17 GREP="grep -rl"
18fi
19
20#look for a couple of things that should only be set by select keywords
21for file in \
22 $($GREP "$SYMBOLS" configs) ; do \
23 echo "Error: $file seems to be a full config"; \
24 done