commit:     934849080c2ec3996835c756421f5e22c693c736
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 10 19:39:37 2015 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Sep 10 19:39:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=93484908

workaround bug #560166 by setting USE more properly

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

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 91a2b5f..68622f2 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -167,8 +167,15 @@ setup_gcc(){
 
 setup_pkgmgr(){
        # Set bindist USE flag if clst_BINDIST is set
-       [ "${clst_target}" != "stage1" ] && [ -e "${clst_make_conf}" ] \
-               && [ -n "${clst_BINDIST}" ] && echo "USE=\"\${USE} bindist\"" 
>> "${clst_make_conf}"
+       if [ "${clst_target}" != "stage1" ] && [ -e "${clst_make_conf}" ] \
+               && [ -n "${clst_BINDIST}" ]; then
+               if grep -q ^USE "${clst_make_conf}"; then
+                       echo "USE=\"\${USE} bindist\"" >> "${clst_make_conf}"
+               else
+                       echo "USE=\"bindist\"" >> "${clst_make_conf}"
+               fi
+
+       fi
 
        # We need to merge our package manager with USE="build" set in case it 
is
        # portage to avoid frying our /etc/portage/make.conf file.  Otherwise, 
we could
@@ -234,6 +241,7 @@ cleanup_stages() {
 
        # Remove bindist from use
        sed -i "/USE=\"\${USE} bindist\"/d" "${clst_make_conf}"
+       sed -i "/USE=\"bindist\"/d" "${clst_make_conf}"
 
        [ "${clst_target}" != "tinderbox" ] && rm -f /var/log/emerge.log 
/var/log/portage/elog/*
 }

Reply via email to