flag-o-matic.eclass: add more verbose conditionals
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 17 Mar 2020 08:33:20 +0000 (08:33 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 17 Mar 2020 18:00:13 +0000 (18:00 +0000)
To ease debugging by pluggins debug statements convert
    foo || return 1
into
    if ! foo; then
        return 1
    fi

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/flag-o-matic.eclass

index 39dae290af022a597847370b302285ca507f6414..9ef9ac3685e00f48268e71f40812b42c72fd8faf 100644 (file)
@@ -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=()