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 <leah@libreboot.org>
btrfsvols
Leah Rowe 2023-10-20 09:11:29 +01:00
parent baa3d4f217
commit 31b35bb4ce
2 changed files with 4 additions and 4 deletions

View File

@ -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
}

View File

@ -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}"