commit:     3dcaf40a13cf6f1e499c457df319763811aae097
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat May 16 00:17:29 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat May 16 00:29:22 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3dcaf40a

targets: Drop setup_pkgmgr()

It's not safe to update portage this way. See

        https://bugs.gentoo.org/722748

Additionally, it doesn't seem important to install/update the package
manager first. In all cases except stage1 the seed stage will have an
up-to-date package manager and in stage1 update_seed can handle that.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 targets/embedded/chroot.sh          |  2 --
 targets/livecd-stage1/chroot.sh     |  3 ---
 targets/stage1/chroot.sh            |  3 ---
 targets/stage3/chroot.sh            |  3 ---
 targets/stage4/chroot.sh            |  3 ---
 targets/support/chroot-functions.sh | 16 ----------------
 6 files changed, 30 deletions(-)

diff --git a/targets/embedded/chroot.sh b/targets/embedded/chroot.sh
index 56d40a4e..2fbba278 100755
--- a/targets/embedded/chroot.sh
+++ b/targets/embedded/chroot.sh
@@ -6,8 +6,6 @@ source /tmp/chroot-functions.sh
 export DESTROOT="${clst_root_path}"
 export clst_root_path="/"
 
-setup_pkgmgr
-
 echo "Installing dependencies into ${DESTROOT}..."
 run_merge -o "${clst_embedded_packages}"
 

diff --git a/targets/livecd-stage1/chroot.sh b/targets/livecd-stage1/chroot.sh
index 9ddf8d42..d143927e 100755
--- a/targets/livecd-stage1/chroot.sh
+++ b/targets/livecd-stage1/chroot.sh
@@ -2,7 +2,4 @@
 
 source /tmp/chroot-functions.sh
 
-## START BUILD
-setup_pkgmgr
-
 run_merge --update --deep --newuse "${clst_packages}"

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index b48fda65..9c7ef6ca 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -20,9 +20,6 @@ then
        exit 1
 fi
 
-## Setup seed pkgmgr to ensure latest
-clst_root_path=/ setup_pkgmgr "build"
-
 # We need to ensure the base stage3 has USE="bindist"
 # if BINDIST is set to avoid issues with openssl / openssh
 [ -e ${clst_make_conf} ] && echo "USE=\"${BINDIST} ${USE}\"" >> 
${clst_make_conf}

diff --git a/targets/stage3/chroot.sh b/targets/stage3/chroot.sh
index e6712015..37001db0 100755
--- a/targets/stage3/chroot.sh
+++ b/targets/stage3/chroot.sh
@@ -2,9 +2,6 @@
 
 source /tmp/chroot-functions.sh
 
-## START BUILD
-setup_pkgmgr
-
 export CONFIG_PROTECT="-* /etc/locale.gen"
 
 echo "$locales" > /etc/locale.gen

diff --git a/targets/stage4/chroot.sh b/targets/stage4/chroot.sh
index d1838644..3b107e5c 100755
--- a/targets/stage4/chroot.sh
+++ b/targets/stage4/chroot.sh
@@ -2,9 +2,6 @@
 
 source /tmp/chroot-functions.sh
 
-## START BUILD
-setup_pkgmgr
-
 echo "Bringing system up to date using profile specific use flags"
 run_merge -u @system
 

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 2fe5ac00..993dc209 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -181,22 +181,6 @@ setup_gcc(){
        fi
 }
 
-setup_pkgmgr(){
-       # 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
-       # just let emerge @system could merge it.
-       # Use --update or portage might just waste time/cycles and reinstall 
the same version.
-       # Use --newuse to make sure it rebuilds with any changed use flags.
-       if [ -n "$1" ];then
-               echo "Adding USE=\"\${USE} $1\" to make.conf for portage build"
-               [ -e "${clst_make_conf}" ] && echo "USE=\"\${USE} $1\"" >> 
"${clst_make_conf}"
-               run_merge --oneshot --update --newuse sys-apps/portage
-               sed -i "/USE=\"\${USE} $1\"/d" "${clst_make_conf}"
-       else
-               run_merge --oneshot --update --newuse sys-apps/portage
-       fi
-}
-
 cleanup_distcc() {
        LIBDIR=$(get_libdir)
        rm -rf /etc/distcc/hosts

Reply via email to