From 86cd2bcb764d253372a22abafcf4b54ddbe7a72b Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 17 Mar 2020 08:33:20 +0000 Subject: [PATCH] flag-o-matic.eclass: add more verbose conditionals To ease debugging by pluggins debug statements convert foo || return 1 into if ! foo; then return 1 fi Signed-off-by: Sergei Trofimovich --- eclass/flag-o-matic.eclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 39dae290af02..9ef9ac3685e0 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -434,13 +434,20 @@ test-flag-PROG() { local lang=$2 shift 2 - [[ -z ${comp} || -z $1 ]] && return 1 + if [[ -z ${comp} ]]; then + return 1 + fi + if [[ -z $1 ]]; then + return 1 + fi # verify selected compiler exists before using it comp=($(tc-get${comp})) # 'comp' can already contain compiler options. # 'type' needs a binary name - type -p ${comp[0]} >/dev/null || return 1 + if ! type -p ${comp[0]} >/dev/null; then + return 1 + fi # Set up test file. local in_src in_ext cmdline_extra=() -- 2.26.2