1
0

add kconfig helper functions

This commit is contained in:
Konstantin Demin 2021-03-31 08:54:40 +03:00
parent ac12fc459b
commit 100187ca04
Signed by: krd
GPG Key ID: 1F33CB0BA4731BC6

View File

@ -0,0 +1,13 @@
#!/bin/zsh
kconf-set() {
local n=$1 v=$2 ; shift 2
grep -ElZ "^((CONFIG_)?$n=|# (CONFIG_)?$n is not set)" "$@" \
| xargs -0 -r sed -i -E -e "s/^(((CONFIG_)?$n)=.+|# ((CONFIG_)?$n) is not set)\$/\\2\\4=$v/"
}
kconf-unset() {
local n=$1 ; shift
grep -ElZ "^(CONFIG_)?$n=" "$@" \
| xargs -0 -r sed -i -E -e "s/^((CONFIG_)?$n)=.+\$/# \\1 is not set/"
}