diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-09-10 13:43:47 +0100 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-09-10 13:49:34 +0100 |
| commit | e9735841230c199029fae80d25caca13e9533c6d (patch) | |
| tree | 54397a4bdb116df5dd375f43fa422f3db6a24637 /include | |
| parent | afdf8c7733f81ca196c70a40566ec75111c31c33 (diff) | |
mk: generalised dispatch loop
with this new function, i can turn commands on and
off by virtue of config. for now, behaviour is
unchanged, but this new design means i will be
able to disable certain commands in child processes
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/lib.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/lib.sh b/include/lib.sh index 812341f4..840c5cf5 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -27,6 +27,11 @@ update_xbmkver() err "can't write '$versiondate'" "update_xbmkver" "$@"; : } +version() +{ + printf "%s\nWebsite: %s\n" "$relname" "$projectsite" +} + xbmk_sanitize_version() { if [ -z "$version" ]; then @@ -222,6 +227,31 @@ x_() fi } +xeq() +{ + if [ $# -lt 2 ]; then + err "no args" xeq + fi + xbcmd="$1" + chk="$2" + shift 2 + + case "$chk" in + -*) + return 1 + ;; + *) + for eq in "$@"; do + if [ "$chk" = "$eq" ]; then + return 0 + fi + done + ;; + esac + + err "bad command" xeq "$xbcmd" "$chk" "$@" +} + xchk() { if [ $# -lt 3 ]; then |
