From d5be5ded1a5a2bf1eca2d358faec28e3af86e300 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 20 Feb 2008 02:00:07 +0000 Subject: [PATCH] Added a cleanup_stages function and added it to the appropriate places. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1307 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 12 ++++++++++ targets/embedded/embedded-preclean-chroot.sh | 11 +-------- targets/grp/grp-preclean-chroot.sh | 11 +-------- .../livecd-stage1-preclean-chroot.sh | 11 +-------- targets/stage1/stage1-chroot.sh | 6 ----- targets/stage1/stage1-preclean-chroot.sh | 12 +--------- targets/stage2/stage2-preclean-chroot.sh | 6 +---- targets/stage3/stage3-chroot.sh | 5 ---- targets/stage3/stage3-preclean-chroot.sh | 6 +---- targets/stage4/stage4-preclean-chroot.sh | 11 ++++++++- targets/support/chroot-functions.sh | 24 +++++++++++++++---- .../tinderbox/tinderbox-preclean-chroot.sh | 1 - 12 files changed, 48 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fcc89bb..3e652379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,18 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 20 Feb 2008; Chris Gianelloni + targets/embedded/embedded-preclean-chroot.sh, + targets/grp/grp-preclean-chroot.sh, + targets/livecd-stage1/livecd-stage1-preclean-chroot.sh, + targets/stage1/stage1-chroot.sh, targets/stage1/stage1-preclean-chroot.sh, + targets/stage2/stage2-preclean-chroot.sh, targets/stage3/stage3-chroot.sh, + targets/stage3/stage3-preclean-chroot.sh, + targets/stage4/stage4-preclean-chroot.sh, + targets/support/chroot-functions.sh, + targets/tinderbox/tinderbox-preclean-chroot.sh: + Added a cleanup_stages function and added it to the appropriate places. + 20 Feb 2008; Chris Gianelloni targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh, targets/livecd-stage1/livecd-stage1-chroot.sh, diff --git a/targets/embedded/embedded-preclean-chroot.sh b/targets/embedded/embedded-preclean-chroot.sh index 608c9fd4..2e8814b5 100755 --- a/targets/embedded/embedded-preclean-chroot.sh +++ b/targets/embedded/embedded-preclean-chroot.sh @@ -1,14 +1,5 @@ #!/bin/bash . /tmp/chroot-functions.sh -update_env_settings -if [ -n "${clst_DISTCC}" ] -then - cleanup_distcc -fi - -if [ -n "${clst_ICECREAM}" ] -then - cleanup_icecream -fi +cleanup_stages diff --git a/targets/grp/grp-preclean-chroot.sh b/targets/grp/grp-preclean-chroot.sh index 3cefd563..948cf2ac 100755 --- a/targets/grp/grp-preclean-chroot.sh +++ b/targets/grp/grp-preclean-chroot.sh @@ -1,16 +1,7 @@ #!/bin/bash . /tmp/chroot-functions.sh -update_env_settings -if [ -n "${clst_DISTCC}" ] -then - cleanup_distcc -fi - -if [ -n "${clst_ICECREAM}" ] -then - cleanup_icecream -fi +cleanup_stages gconftool-2 --shutdown diff --git a/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh b/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh index 608c9fd4..2e8814b5 100755 --- a/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh @@ -1,14 +1,5 @@ #!/bin/bash . /tmp/chroot-functions.sh -update_env_settings -if [ -n "${clst_DISTCC}" ] -then - cleanup_distcc -fi - -if [ -n "${clst_ICECREAM}" ] -then - cleanup_icecream -fi +cleanup_stages diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index 3ec42db9..b4f6f2cf 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -23,9 +23,3 @@ 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}" - -rm -f /var/lib/portage/world -touch /var/lib/portage/world - -rm -f /var/log/emerge.log /var/log/portage/elog/* /etc/xml/catalog -rm -rf /var/tmp/* diff --git a/targets/stage1/stage1-preclean-chroot.sh b/targets/stage1/stage1-preclean-chroot.sh index 84bcb03d..53cb849a 100755 --- a/targets/stage1/stage1-preclean-chroot.sh +++ b/targets/stage1/stage1-preclean-chroot.sh @@ -17,14 +17,4 @@ else echo UTC > /etc/TZ fi -#if [ -n "${clst_CCACHE}" ] -#then -# run_emerge -C dev-util/ccache || exit 1 -#fi - -#if [ -n "${clst_DISTCC}" ] -#then -# run_emerge -C sys-devel/distcc || exit 1 -#fi - -#cleanup_distcc +cleanup_stages diff --git a/targets/stage2/stage2-preclean-chroot.sh b/targets/stage2/stage2-preclean-chroot.sh index f7813944..0636bb4e 100755 --- a/targets/stage2/stage2-preclean-chroot.sh +++ b/targets/stage2/stage2-preclean-chroot.sh @@ -2,7 +2,7 @@ . /tmp/chroot-functions.sh -update_env_settings +cleanup_stages if [ -n "${clst_CCACHE}" ] then @@ -12,13 +12,9 @@ fi if [ -n "${clst_DISTCC}" ] then run_emerge -C sys-devel/distcc || exit 1 - cleanup_distcc fi if [ -n "${clst_ICECREAM}" ] then run_emerge -C sys-devel/icecream || exit 1 - cleanup_icecream fi - -rm -f /var/log/emerge.log diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index 1daf0341..1bf134b4 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -6,8 +6,3 @@ setup_portage run_emerge "-e system" - -rm -f /var/lib/portage/world -touch /var/lib/portage/world - -rm -f /var/log/emerge.log /var/log/portage/elog/* diff --git a/targets/stage3/stage3-preclean-chroot.sh b/targets/stage3/stage3-preclean-chroot.sh index f7813944..0636bb4e 100755 --- a/targets/stage3/stage3-preclean-chroot.sh +++ b/targets/stage3/stage3-preclean-chroot.sh @@ -2,7 +2,7 @@ . /tmp/chroot-functions.sh -update_env_settings +cleanup_stages if [ -n "${clst_CCACHE}" ] then @@ -12,13 +12,9 @@ fi if [ -n "${clst_DISTCC}" ] then run_emerge -C sys-devel/distcc || exit 1 - cleanup_distcc fi if [ -n "${clst_ICECREAM}" ] then run_emerge -C sys-devel/icecream || exit 1 - cleanup_icecream fi - -rm -f /var/log/emerge.log diff --git a/targets/stage4/stage4-preclean-chroot.sh b/targets/stage4/stage4-preclean-chroot.sh index 31fa8d6b..2f73ba44 100755 --- a/targets/stage4/stage4-preclean-chroot.sh +++ b/targets/stage4/stage4-preclean-chroot.sh @@ -1,4 +1,13 @@ #!/bin/bash . /tmp/chroot-functions.sh -#update_env_settings + +if [ -n "${clst_DISTCC}" ] +then + cleanup_distcc +fi + +if [ -n "${clst_ICECREAM}" ] +then + cleanup_icecream +fi diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index 54277041..d9123554 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -178,19 +178,35 @@ cleanup_distcc() { rm -rf /etc/distcc/hosts for i in cc gcc c++ g++; do # TODO: change to use get_libdir - rm /usr/lib/distcc/bin/${i} + rm -f /usr/lib/distcc/bin/${i} ln -s /usr/bin/distcc /usr/lib/distcc/bin/${i} done - rm /usr/lib/distcc/bin/*-wrapper + rm -f /usr/lib/distcc/bin/*-wrapper } cleanup_icecream() { LIBDIR=$(get_libdir) for i in cc gcc c++ g++; do - rm /usr/${LIBDIR}/icecc/bin/${i} + rm -f /usr/${LIBDIR}/icecc/bin/${i} ln -s /usr/bin/icecc /usr/${LIBDIR}/icecc/bin/${i} done - rm /usr/${LIBDIR}/icecc/bin/*-wrapper + rm -f /usr/${LIBDIR}/icecc/bin/*-wrapper +} + +cleanup_stages() { + if [ -n "${clst_DISTCC}" ] + then + cleanup_distcc + fi + if [ -n "${clst_ICECREAM}" ] + then + cleanup_icecream + fi + rm -f /var/lib/portage/world + touch /var/lib/portage/world + + rm -f /var/log/emerge.log /var/log/portage/elog/* + rm -rf /var/tmp/* } update_env_settings(){ diff --git a/targets/tinderbox/tinderbox-preclean-chroot.sh b/targets/tinderbox/tinderbox-preclean-chroot.sh index 608c9fd4..2f73ba44 100755 --- a/targets/tinderbox/tinderbox-preclean-chroot.sh +++ b/targets/tinderbox/tinderbox-preclean-chroot.sh @@ -1,7 +1,6 @@ #!/bin/bash . /tmp/chroot-functions.sh -update_env_settings if [ -n "${clst_DISTCC}" ] then -- 2.26.2