1
0

zsh: update
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2024-03-04 15:35:55 +03:00
parent 25123cece2
commit 8834da817c
20 changed files with 265 additions and 49 deletions

View File

@@ -1,24 +1,22 @@
#!/bin/zsh
kconf-set() {
[ -n "${1:?}" ] || return 1
local n=$1 v=$2
local n v
n="${1:?}" v=$2
shift 2
[ $# -gt 0 ] || return 2
[ $# -gt 0 ] || return 1
command 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() {
[ -n "${1:?}" ] || return 1
local n=$1
local n
n="${1:?}"
shift
[ $# -gt 0 ] || return 2
[ $# -gt 0 ] || return 1
command grep -ElZ "^(CONFIG_)?$n=" "$@" \
| xargs -0 -r sed -i -E -e "s/^((CONFIG_)?$n)=.+\$/# \\1 is not set/"