summaryrefslogtreecommitdiff
path: root/include/lib.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-05-07 13:27:25 +0100
committerLeah Rowe <leah@libreboot.org>2025-05-07 13:28:55 +0100
commit0faef899469818410e5e6d481f1e6c4fa5ad3d3d (patch)
tree84061935c0e45eff7201874914b9fdec6e41ea39 /include/lib.sh
parent2b7f6b7d7cedfcc7661f02b8092707fde09460a0 (diff)
lib.sh: support any command on find_exec()
right now, we assume "find", but it adds any number of arguments next to that. change it instead to support any command, where the assumption is that it would generate a list of files and directories. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
-rw-r--r--include/lib.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/lib.sh b/include/lib.sh
index a125181b..f20b17e9 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -140,7 +140,8 @@ chkvars()
# e.g. coreboot is multi-tree, so 1
singletree()
{
- ( fx_ "exit 1" "config/$1/"*/ -type f -name "target.cfg" ) || return 1
+ ( fx_ "exit 1" find "config/$1/"*/ -type f -name "target.cfg" ) || \
+ return 1
}
fe_()
@@ -158,7 +159,7 @@ find_ex()
xmsg="$1" && shift 1
fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd"
xx="$1" && shift 1
- $xmsg find "$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || \
+ $xmsg "$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || \
err "!find $(echo "$@") > \"$fd\""
dx_ "$xx" "$fd" || break
x_ rm -f "$fd"