commit:     79af2476b55a6b01e612c9eb0cb98755a51da780
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jan 23 00:00:00 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 17:50:41 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=79af2476

gcc-config: Do not call 'python' directly.

'python' is not available with dev-lang/python-exec[-native-symlinks].

Bug: https://bugs.gentoo.org/766597
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 gcc-config | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/gcc-config b/gcc-config
index 615e43b..0eb1b5f 100755
--- a/gcc-config
+++ b/gcc-config
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 2002-2019 Gentoo Authors
+# Copyright 2002-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Format of /etc/env.d/gcc/ contents:
@@ -155,11 +155,10 @@ get_chost() {
 
        export CHOST
 
-       # make sure portage isnt broken
-       if python -V &>/dev/null ; then
-               CHOST=$(portageq envvar CHOST 2>/dev/null)
-       else
-               ewarn "Python seems to be broken, attempting to locate CHOST 
ourselves ..."
+       # Make sure Portage isn't broken.
+       CHOST=$(portageq envvar CHOST 2>/dev/null)
+       if [[ $? != 0 || -z ${CHOST} ]] ; then
+               ewarn "Python or Portage seems to be broken, attempting to 
locate CHOST ourselves ..."
                CHOST=$(try_real_hard_to_find_CHOST)
        fi
 

Reply via email to