On Mon,  1 Sep 2014 19:31:40 -0700
Brian Dolbec <[email protected]> wrote:

> ---
>  targets/stage1/stage1-chroot.sh     |  1 +
>  targets/stage2/stage2-chroot.sh     |  1 +
>  targets/support/chroot-functions.sh | 13 ++++++++++---
>  3 files changed, 12 insertions(+), 3 deletions(-)
> 

Here is an updated patch based on discussions with Rick.

From 52024ff70bf044f026330efd5a167139649d529a Mon Sep 17 00:00:00 2001
From: Brian Dolbec <[email protected]>
Date: Mon, 1 Sep 2014 15:10:38 -0700
Subject: [PATCH] setup_pkgmgr(): Make the 'build' use flag passed in
To: [email protected]

The "build" USE flag is only needed for the stage1 build.
It also causes other errors in later stages.
This makes setup_pkgmgr() takes an optional USE flag string
parameter to be added to the USE variable.
---
 targets/stage1/stage1-chroot.sh     |  2 +-
 targets/support/chroot-functions.sh | 13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index ed83f38..eccbd3f 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -21,7 +21,7 @@ then
 fi
 
 ## Setup seed pkgmgr to ensure latest
-clst_root_path=/ setup_pkgmgr
+clst_root_path=/ setup_pkgmgr "build"
 
 # Update stage3
 if [ -n "${clst_update_seed}" ]; then
diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 3495f14..0659ee0 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -170,9 +170,16 @@ setup_pkgmgr(){
        # portage to avoid frying our /etc/portage/make.conf file.  Otherwise, 
we could
        # just let emerge @system could merge it.
        # Use --update or portage will reinstall the same version.
-       [ -e /etc/portage/make.conf ] && echo 'USE="${USE} build"' >> 
/etc/portage/make.conf
-       run_merge --oneshot --update sys-apps/portage
-       sed -i '/USE="${USE} build"/d' /etc/portage/make.conf
+       if [ -n "$1" ];then
+               echo "Adding USE='${USE} $1' to make.conf for portage build"
+               [ -e /etc/portage/make.conf ] && echo 'USE="${USE} $1"' >> 
/etc/portage/make.conf
+               run_merge --oneshot --update sys-apps/portage
+               sed -i '/USE="${USE} $1"/d' /etc/portage/make.conf
+       else
+               echo "Updating portage with USE='${USE}'"
+               run_merge --oneshot --update sys-apps/portage
+       fi
+
 }
 
 cleanup_distcc() {
-- 
2.1.0



-- 
Brian Dolbec <dolsen>


Reply via email to