From 31b35bb4ceb785a5649d25d7fcf68c93da82bcde Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 20 Oct 2023 09:11:29 +0100 Subject: [PATCH] include/git: fix error caused by sh idiosyncrasy when [] is used right at the end of a function, or certain loops/subshells, some sh implementations will just return a non-zero exit Signed-off-by: Leah Rowe --- include/git.sh | 3 ++- script/update/trees | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/git.sh b/include/git.sh index 7f4b1f40..a6ce1cbf 100755 --- a/include/git.sh +++ b/include/git.sh @@ -141,6 +141,7 @@ git_am_patches() ) for patches in "${patchdir}/"*; do [ -L "${patches}" ] && continue - [ -d "${patches}" ] && git_am_patches "${sdir}" "${patches}" + [ ! -d "${patches}" ] && continue + git_am_patches "${sdir}" "${patches}" done } diff --git a/script/update/trees b/script/update/trees index 88f22c31..64958522 100755 --- a/script/update/trees +++ b/script/update/trees @@ -145,9 +145,8 @@ handle_src_tree() . "${target_dir}/target.cfg" || \ err "handle_src_tree ${target_dir}: cannot load target.cfg" - for ix in arch tree; do - eval "[ -z \"\${$ix}\" ] && err \"handle_src: $ix undefined\"" - done + [ -z "${arch}" ] && err "handle_src_tree $project/$tree: arch unset" + [ -z "${tree}" ] && err "handle_src_tree $project/$tree: tree unset" codedir="src/${project}/${tree}"