Rather than using the environment, we write out our USE to make.conf, then remove...
authorChris Gianelloni <wolf31o2@gentoo.org>
Thu, 28 Feb 2008 04:26:14 +0000 (04:26 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Thu, 28 Feb 2008 04:26:14 +0000 (04:26 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1334 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
targets/grp/grp-chroot.sh
targets/stage1/stage1-chroot.sh
targets/support/kmerge.sh
targets/support/livecdfs-update.sh

index f68aa944de42efdd8a2e3bcb366c7ca1c4bdf908..b9967cd2615283c3deaaabe2983409211c3a4c2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  28 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
+  targets/grp/grp-chroot.sh, targets/stage1/stage1-chroot.sh,
+  targets/support/kmerge.sh, targets/support/livecdfs-update.sh:
+  Rather than using the environment, we write out our USE to make.conf, then
+  remove it once we're done. We don't bother adding clst_HOSTUSE, since it'll
+  be written to make.conf, already.
+
   28 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh,
   targets/livecd-stage1/livecd-stage1-chroot.sh,
index 3ed29b6153baa7bf1104366e6b5deecf07d21f0e..a99f5316c22d6c61e7e49847e94060b2eaef2730 100755 (executable)
@@ -5,14 +5,8 @@ source /tmp/chroot-functions.sh
 ## START BUILD
 setup_pkgmgr
 
-unset DISTDIR
-
-# Don't grab MS core fonts, etc.
-export USE="${USE} ${clst_HOSTUSE} ${clst_use}"
-
 if [ "${clst_grp_type}" = "pkgset" ]
 then
-       unset DISTDIR
        export PKGDIR="/tmp/grp/${clst_grp_target}"
 
        run_merge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
@@ -20,5 +14,4 @@ then
 else
        DISTDIR="/tmp/grp/${clst_grp_target}" run_merge --fetchonly \
                ${clst_grp_packages} || exit 1
-       unset PKGDIR
 fi
index 1b7204f1617eaed020c5d04c1decabf46e08fa44..8476114b5557a09caad7022b44fd1a91ff57a12a 100755 (executable)
@@ -6,9 +6,8 @@ export clst_buildpkgs="$(/tmp/build.py)"
 source /tmp/chroot-functions.sh
 
 # Setup our environment
-export STAGE1_USE="$(portageq envvar STAGE1_USE)"
-export USE="-* bindist build ${STAGE1_USE}"
-export FEATURES="${clst_myfeatures} nodoc noman noinfo"
+STAGE1_USE="$(portageq envvar STAGE1_USE)"
+FEATURES="${clst_myfeatures} nodoc noman noinfo"
 
 ## Sanity check profile
 if [ -z "${clst_buildpkgs}" ]
@@ -22,6 +21,15 @@ fi
 ## START BUILD
 clst_root_path=/ setup_pkgmgr
 
-USE="-build" run_merge "--oneshot --nodeps virtual/baselayout"
+# First, we drop in a known-good baselayout
+[ -e ${ROOT}/etc/make.conf ] && \
+       echo 'USE="${USE} -build' >> ${ROOT}/etc/make.conf
+run_merge "--oneshot --nodeps virtual/baselayout"
+sed -i '/USE="${USE} -build/d' ${ROOT}/etc/make.conf
 
-USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}" run_merge "--noreplace --oneshot --newuse ${clst_buildpkgs}"
+[ -e ${ROOT}/etc/make.conf ] && \
+       echo 'USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}"' \
+       >> ${ROOT}/etc/make.conf
+run_merge "--noreplace --oneshot --newuse ${clst_buildpkgs}"
+sed -i '/USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}"/d' \
+       ${ROOT}/etc/make.conf
index 6ab2d3c008e367af8911f78f0f60ffd697bdb406..b5fa5221ad15ab2e819bdd6827291141fc186d45 100755 (executable)
@@ -126,7 +126,6 @@ filtered_kname=${clst_kname/\//_}
 filtered_kname=${filtered_kname/\./_}
 
 eval "clst_kernel_use=\$clst_boot_kernel_${filtered_kname}_use"
-export USE="${clst_kernel_use} ${clst_HOSTUSE}"
 
 eval "clst_kernel_gk_kernargs=\$clst_boot_kernel_${filtered_kname}_gk_kernargs"
 eval "clst_ksource=\$clst_boot_kernel_${filtered_kname}_sources"
@@ -185,27 +184,19 @@ then
        fi
 fi
 
-mkdir -p /tmp/kerncache/${clst_kname}
-       
+[ -e /etc/make.conf ] && echo 'USE="${USE} ${clst_kernel_use} symlink build' \
+       >> /etc/make.conf
+
 if [ -n "${clst_KERNCACHE}" ]
 then
-       ROOT=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} USE="${USE} symlink build" emerge --nodeps -uqkb  "${clst_ksource}" || exit 1
-#      KERNELVERSION=`/usr/lib/portage/bin/portageq best_visible / "${clst_ksource}"`
-#      if [ ! -e /etc/portage/profile/package.provided ]
-#      then
-#              mkdir -p /etc/portage/profile
-#              echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
-#      else
-#              if ( ! grep -q "^${KERNELVERSION}"  /etc/portage/profile/package.provided ) 
-#              then
-#                      echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
-#              fi
-#      fi
-       [ -d /usr/src/linux ] && rm /usr/src/linux
+mkdir -p /tmp/kerncache/${clst_kname}
+       ROOT=/tmp/kerncache/${clst_kname} PKGDIR=${PKGDIR} run_emerge --nodeps -uqkb  "${clst_ksource}" || exit 1
+       [ -l /usr/src/linux ] && rm -f /usr/src/linux
        ln -s /tmp/kerncache/${clst_kname}/usr/src/linux /usr/src/linux
 else
-               USE="${USE} symlink build" emerge "${clst_ksource}" || exit 1
+       run_emerge "${clst_ksource}" || exit 1
 fi
+sed -i '/USE="${USE} ${clst_kernel_use} symlink build/d' /etc/make.conf
 
 # If catalyst has set to a empty string, extraversion wasn't specified so we
 # skip this part
index d73efd849bd8c19c22693603413ecb70a066e552..57d4cbd59f3b284f5e0c52c1c3447b86f035ded6 100755 (executable)
@@ -310,6 +310,7 @@ case ${clst_livecd_type} in
 
                # This gives us our list of system packages for the installer
                mkdir -p /usr/livecd
+               ### XXX: Andrew says we don't need this anymore
                USE="-* $(cat /var/db/pkg/sys-libs/glibc*/USE)" emerge -eqp system | grep -e '^\[ebuild' | sed -e 's:^\[ebuild .\+\] ::' -e 's: .\+$::' > /usr/livecd/systempkgs.txt
 
                # This is my hack to reduce tmpfs usage