From 6aa007caa3b89635bf4be4cb8ff614618daa18dc Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 21 Feb 2008 02:03:30 +0000 Subject: [PATCH] Moved creating of stage1 package list to the beginning of stage1-chroot.sh so we can get the output with --debug, added --newuse to the options for stage1, as we should always rebuild any package where the USE has changed, removed removal of portage logs from stage2-chroot.sh since it is being done by cleanup_stages, moved world removal in cleanup_stages into a check for stages 1 through 3, made update_env_settings check for the existence of env-update before running it since we now run update_env_settings by default everywhere chroot-functions.sh is sourced, and added a section to show_debug to list the packages, since we don't yet force-enable verbose with debug. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1318 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 13 ++++++++++ targets/stage1/stage1-chroot.sh | 6 +++-- targets/stage2/stage2-chroot.sh | 1 - targets/support/chroot-functions.sh | 38 ++++++++++++++++++++++++++--- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb6c5698..b7748d6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,19 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 21 Feb 2008; Chris Gianelloni + targets/stage1/stage1-chroot.sh, targets/stage2/stage2-chroot.sh, + targets/support/chroot-functions.sh: + Moved creating of stage1 package list to the beginning of stage1-chroot.sh + so we can get the output with --debug, added --newuse to the options for + stage1, as we should always rebuild any package where the USE has changed, + removed removal of portage logs from stage2-chroot.sh since it is being done + by cleanup_stages, moved world removal in cleanup_stages into a check for + stages 1 through 3, made update_env_settings check for the existence of + env-update before running it since we now run update_env_settings by default + everywhere chroot-functions.sh is sourced, and added a section to show_debug + to list the packages, since we don't yet force-enable verbose with debug. + 20 Feb 2008; Chris Gianelloni catalyst, modules/catalyst_lock.py: Since my python sucks and I don't feel like troubleshooting it at the diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 9f974764..e4f34474 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,9 +1,11 @@ #!/bin/bash +# We do this first, so we know our package list for --debug +export clst_buildpkgs="$(/tmp/build.py)" + source /tmp/chroot-functions.sh # Setup our environment -export clst_buildpkgs="$(/tmp/build.py)" export STAGE1_USE="$(portageq envvar STAGE1_USE)" export USE="-* bindist build ${STAGE1_USE}" export FEATURES="${clst_myfeatures} nodoc noman noinfo" @@ -22,4 +24,4 @@ clst_root_path=/ setup_portage USE="-build" run_emerge "--oneshot --nodeps virtual/baselayout" -USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}" run_emerge "--noreplace --oneshot ${clst_buildpkgs}" +USE="-* bindist build ${STAGE1_USE} ${HOSTUSE}" run_emerge "--noreplace --oneshot --newuse ${clst_buildpkgs}" diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index e696d044..ca86d901 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -20,4 +20,3 @@ fi ## START BUILD /usr/portage/scripts/bootstrap.sh ${bootstrap_opts} || exit 1 -rm -f /var/log/emerge.log /var/log/portage/elog/* diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index d9123554..e15c8309 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -202,15 +202,30 @@ cleanup_stages() { then cleanup_icecream fi - rm -f /var/lib/portage/world - touch /var/lib/portage/world + case ${clst_target} in + stage1|stage2|stage3) + rm -f /var/lib/portage/world + touch /var/lib/portage/world + ;; + *) + echo "Skipping removal of world file for ${clst_target}" + ;; + esac rm -f /var/log/emerge.log /var/log/portage/elog/* rm -rf /var/tmp/* } update_env_settings(){ - /usr/sbin/env-update + which env-update > /dev/null 2>&1 + ret=$? + if [ $ret -eq 0 ] + then + ENV_UPDATE=`which env-update` + ${ENV_UPDATE} + else + echo "WARNING: env-update not found, skipping!" + fi source /etc/profile [ -f /tmp/envscript ] && source /tmp/envscript } @@ -265,7 +280,9 @@ run_emerge() { show_debug() { if [ "${clst_DEBUG}" = "1" ] then + unset PACKAGES echo "DEBUG:" + echo "Profile/target info:" echo "Profile inheritance:" python -c 'import portage; print portage.settings.profiles' echo @@ -287,6 +304,21 @@ show_debug() { echo "KERNEL_ABI: $(portageq envvar KERNEL_ABI)" echo "MULTILIB_ABIS: $(portageq envvar MULTILIB_ABIS)" echo + ### XXX: This is temporary until we make --debug force-enable --verbose + if [ -n "${clst_buildpkgs}" ] + then + PACKAGES=${clst_buildpkgs} + elif [ -n "${clst_packages}" ] + then + PACKAGES=${clst_packages} + fi + if [ -n "${PACKAGES}" ] + then + echo "Packages:" + echo "${PACKAGES}" + echo + fi + ### XXX: end of section to remove fi } -- 2.26.2