Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Martin Roth | 037dbe4 | 2017-06-03 21:15:57 -0600 | [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 | 037dbe4 | 2017-06-03 21:15:57 -0600 | [diff] [blame] | 5 | # DESCR: Verify that the word 'coreboot' is lowercase |
| 6 | |
| 7 | LC_ALL=C export LC_ALL |
| 8 | |
Martin Roth | 7e464dc | 2017-09-01 09:22:43 -0600 | [diff] [blame] | 9 | EXCLUDE='^3rdparty/\|util/crossgcc/xgcc\|Binary file\|coreboot\|COREBOOT\|CorebootPayload\|CorebootModule\|minnowboard.org/Coreboot\|.*\.patch$\|CorebootBdsLib\|^payloads/external' |
Martin Roth | 037dbe4 | 2017-06-03 21:15:57 -0600 | [diff] [blame] | 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 | 037dbe4 | 2017-06-03 21:15:57 -0600 | [diff] [blame] | 15 | GREP_FILES="git grep -in" |
| 16 | |
| 17 | # Check last commit message |
| 18 | if [ -n "$(git log -n 1 | grep -i 'coreboot' | grep -v "$EXCLUDE" )" ]; then |
| 19 | echo "'coreboot' should be lowercase in commit message" |
| 20 | fi |
| 21 | else |
| 22 | GREP_FILES="grep -rin" |
| 23 | fi |
| 24 | |
| 25 | ${GREP_FILES} "coreboot" | grep -v "$EXCLUDE"; |