From 2c78d36bd516dbd313b6f55cad0e06e320cd4c03 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Thu, 20 Feb 2020 06:57:46 +0000 Subject: [PATCH] use actual bool state where applicable within functions --- functions/architectures.sh | 12 ++++++------ functions/stagefile.sh | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/functions/architectures.sh b/functions/architectures.sh index 393d217e8..df61a1edc 100755 --- a/functions/architectures.sh +++ b/functions/architectures.sh @@ -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 diff --git a/functions/stagefile.sh b/functions/stagefile.sh index 101bd5210..fdbab3588 100755 --- a/functions/stagefile.sh +++ b/functions/stagefile.sh @@ -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