singletree/elfcheck: use fx_, not fe_

fe_ returns an error on the find command, but we rely
on the only error ever being our intentional exit, upon
discovering files.

in singletree, the directory being checked was already
checked first, so we know it's safe not to err on find;
and find not reporting an error if no files are found is
ok.

on elfcheck, it's very much the same thing. In fact, we
very much want it to return 0 if the directory doesn't
exist, or if files don't exist within it.

Therefore, use fx_ which is designed for this use-case.

Quick re-cap: fx and fe execute a given function name with
each line outputting by find as an argument, each time. It
is somewhat similar in scope to find's -exec command.

We use fe_ as shorthand in several places all over lbmk.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-05 20:33:02 +01:00
parent 8ca06463eb
commit f98e34a24d
2 changed files with 2 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ chkvars()
# e.g. coreboot is multi-tree, so 1
singletree()
{
( fe_ "exit 1" "config/$1/"*/ -type f -name "target.cfg" ) || return 1
( fx_ "exit 1" "config/$1/"*/ -type f -name "target.cfg" ) || return 1
}
fe_()

2
mk
View File

@@ -371,7 +371,7 @@ check_defconfig()
elfcheck()
{
# TODO: *STILL* very hacky check. do it properly (based on build.list)
( fe_ "exit 1" "$dest_dir" -type f ) || return 1; :
( fx_ "exit 1" "$dest_dir" -type f ) || return 1; :
}
handle_makefile()