commit:     16f334babfb02f67c9d529ce4758fafbe1290787
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 19:55:22 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 19:57:59 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=16f334ba

scripts/bootstrap-prefix: ensure get_libdir doesn't return newlines

When portageq fails, it returns a newline, which we don't want to have
in our LDFLAGS (or anywhere else), so make sure we check if portageq
returned something useful.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index ff5132ae7e..66edd753cf 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1668,7 +1668,11 @@ bootstrap_stage3() {
                fi
        fi
 
-       get_libdir() { portageq envvar LIBDIR_$(portageq envvar ABI) || echo 
lib; }
+       get_libdir() {
+               local l=$(portageq envvar LIBDIR_$(portageq envvar ABI) 
2>/dev/null)
+               [[ -z ${l} ]] && l=lib
+               echo ${l}
+       }
 
        export CONFIG_SHELL="${ROOT}"/tmp/bin/bash
        export CPPFLAGS="-isystem ${ROOT}/usr/include"

Reply via email to