commit: 66d4ffc4ef0dfbf7cd135cd7c54d6623c130c9a4 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Wed Jun 22 19:48:40 2016 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sun Jun 26 15:34:47 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66d4ffc4
toolchain-funcs.eclass: Fix _tc-getPROG with multi-parameter defaults Fix _tc-getPROG function to account correctly for default values that contain program name along with arguments, e.g. the default for CPP containing "$(CC) -E". eclass/toolchain-funcs.eclass | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index e794559..8ecc736 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -22,7 +22,7 @@ inherit multilib _tc-getPROG() { local tuple=$1 local v var vars=$2 - local prog=$3 + local prog=( $3 ) var=${vars%% *} for v in ${vars} ; do @@ -34,11 +34,11 @@ _tc-getPROG() { done local search= - [[ -n $4 ]] && search=$(type -p "$4-${prog}") - [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p "${!tuple}-${prog}") - [[ -n ${search} ]] && prog=${search##*/} + [[ -n $4 ]] && search=$(type -p $4-${prog[0]}) + [[ -z ${search} && -n ${!tuple} ]] && search=$(type -p ${!tuple}-${prog[0]}) + [[ -n ${search} ]] && prog[0]=${search##*/} - export ${var}=${prog} + export ${var}="${prog[*]}" echo "${!var}" } tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }