bash-completion-r1.eclass: Die on pkg-config getter failure
authorMichał Górny <mgorny@gentoo.org>
Fri, 27 Nov 2015 13:49:42 +0000 (14:49 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 29 Nov 2015 10:07:23 +0000 (11:07 +0100)
eclass/bash-completion-r1.eclass

index 255197361229e865099066f283bd5a4749398865..9877baa3fd7eff858029bbd7f159f8b6e706b0e3 100644 (file)
@@ -41,12 +41,13 @@ _bash-completion-r1_get_bashdir() {
        debug-print-function ${FUNCNAME} "${@}"
 
        if $(tc-getPKG_CONFIG) --exists bash-completion &>/dev/null; then
-               local path="$($(tc-getPKG_CONFIG) --variable=$1 bash-completion)"
+               local path
+               path=$($(tc-getPKG_CONFIG) --variable="${1}" bash-completion) || die
                # we need to return unprefixed, so strip from what pkg-config returns
                # to us, bug #477692
                echo "${path#${EPREFIX}}"
        else
-               echo $2
+               echo "${2}"
        fi
 }