commit:     28228aff898a97241568b5de9613a51a52712d99
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 19 03:26:30 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 03:26:30 2016 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=28228aff

targets/support/chroot-functions.sh: Fix CHROOT partial breakage

Since commit:  d05808a7a8313a66a0be67e89867b4c3a1fe5ca0
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo.org> (Wed 09 Sep 2015 
09:32:27 AM PDT)
Subject: only set CHOST in make.conf if we are setting it via catalyst to 
override the profile

CHOST has not been consistently set via the arch/*.py files.  As a consequence, 
there has 
been some silent breakage causing intermittent issues as clst_CHOST was not 
always
present.  Another recent commit 5b3a6639649e2 also changes clst_CHOST to just 
CHOST,
but my testing revealed that this too was unset whne it was used in the 
set_gcc, set_binutils
functions.  The CHOST setting code in set_myfeatures was not run until after 
the gcc and 
binutils settings have been done.

These changes reverts commit 5b3a6639649e2 CHOST change and restores a
consistently set clst_CHOST.  This seetting will rely on the profile setting 
unless overriden by 
 spec file or arch.*.py settings for various subarches.

 targets/support/chroot-functions.sh | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index ed8da84..2f79492 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -17,6 +17,18 @@ trap "echo SIGKILL signal recieved killing $0 with pid 
$$;kill -9 $$" SIGKILL
 #      * kernel recognizes this and generates SIGINT signal
 trap "echo SIGINT signal recieved killing $0 with pid $$;kill -9 $$" SIGINT
 
+# test if CHOST was set on the python side
+if [[ -z "${clst_CHOST}" ]] ; then
+       # No, it wasn't
+       if [[ -z "${clst_chost}" ]] ; then
+               # No override was set, so grab CHOST from the profile
+               export clst_CHOST=$(portageq envvar CHOST)
+       else
+               # Set CHOST from the spec override
+               export clst_CHOST="${clst_chost}"
+       fi
+fi
+
 check_genkernel_version() {
        local version parts=() major minor
 
@@ -146,7 +158,7 @@ setup_myemergeopts(){
 setup_binutils(){
        if [ -x /usr/bin/binutils-config ]
        then
-               my_binutils=$( cd /etc/env.d/binutils; ls ${CHOST}-* | head -n 
1 )
+               my_binutils=$( cd /etc/env.d/binutils; ls ${clst_CHOST}-* | 
head -n 1 )
                if [ -z "${my_binutils}" ]
                then
                        my_binutils=1
@@ -158,7 +170,7 @@ setup_binutils(){
 setup_gcc(){
        if [ -x /usr/bin/gcc-config ]
        then
-               my_gcc=$( cd /etc/env.d/gcc; ls ${CHOST}-* | head -n 1 )
+               my_gcc=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
                if [ -z "${my_gcc}" ]
                then
                        my_gcc=1

Reply via email to