use actual bool state where applicable within functions

This commit is contained in:
Lyndon Brown 2020-02-20 06:57:46 +00:00 committed by Raphaël Hertzog
parent 093a5ea99c
commit 2c78d36bd5
2 changed files with 9 additions and 8 deletions

View File

@ -11,36 +11,36 @@
Check_architectures ()
{
ARCHITECTURES="${@}"
VALID="false"
VALID=false
for ARCHITECTURE in ${ARCHITECTURES}
do
if [ "$(echo ${LB_ARCHITECTURES} | grep ${ARCHITECTURE})" ]
then
VALID="true"
VALID=true
break
fi
done
if [ "${ARCHITECTURES}" = "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" ]
then
VALID="true"
VALID=true
if [ ! -e "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_ARCHITECTURES} was not found"
VALID="false"
VALID=false
fi
if [ ! -x "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_STATIC} is not executable"
VALID="false"
VALID=false
fi
fi
if [ "${VALID}" = "false" ]
if ! $VALID
then
Echo_warning "skipping %s, foreign architecture(s)." "${0}"
exit 0

View File

@ -47,17 +47,18 @@ Require_stagefile ()
FILES="${@}"
NUMBER="$(echo ${@} | wc -w)"
CONTINUE=false
for FILE in ${FILES}
do
# Find at least one of the required stages
if [ -f ${FILE} ]
then
CONTINUE="true"
CONTINUE=true
NAME="${NAME} $(basename ${FILE})"
fi
done
if [ "${CONTINUE}" != "true" ]
if ! $CONTINUE
then
if [ "${NUMBER}" -eq 1 ]
then