From f98e34a24dd21ebafbfac2e019d3a4bc1cf500cb Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 20:33:02 +0100 Subject: 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 --- include/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/lib.sh b/include/lib.sh index b8f99674..2c28b112 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -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_() -- cgit v1.2.1