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 +- mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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_() diff --git a/mk b/mk index 08ac22a2..a438d653 100755 --- a/mk +++ b/mk @@ -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() -- cgit v1.2.1