diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-02-20 06:57:46 +0000 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-03-09 11:17:53 +0000 |
commit | 2c78d36bd516dbd313b6f55cad0e06e320cd4c03 (patch) | |
tree | 346e7e068be9f912619b3b0d975ad2b091dc7392 | |
parent | 093a5ea99c7b1e1c6d716e1f47adbcf250d62f5e (diff) | |
download | vyos-live-build-2c78d36bd516dbd313b6f55cad0e06e320cd4c03.tar.gz vyos-live-build-2c78d36bd516dbd313b6f55cad0e06e320cd4c03.zip |
use actual bool state where applicable within functions
-rwxr-xr-x | functions/architectures.sh | 12 | ||||
-rwxr-xr-x | 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 |