commit:     86cd2bcb764d253372a22abafcf4b54ddbe7a72b
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 17 08:33:20 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Mar 17 18:00:13 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86cd2bcb

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 <slyfox <AT> gentoo.org>

 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 39dae290af0..9ef9ac3685e 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=()

Reply via email to