setup_pkgmgr(): Make the 'build' use flag passed in
[catalyst.git] / targets / support / chroot-functions.sh
index a31e8bf7ac55b5a8feddc4387da37ded97c64a71..ee820edebfe36916d67e33e277e989fe80987e89 100755 (executable)
@@ -170,9 +170,15 @@ 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 might just waste time/cycles and 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() {