From f25c33e36a41678b3ac21fc7ed62361a85a630d3 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Thu, 8 Dec 2005 15:16:48 +0000 Subject: [PATCH] move unmerge.sh to support;move the CLEAN_DELAY,EMERGE_WARNING_DELAY, and CONFIG_PROTECT stuff in the run_emerge function for cleanliness git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@948 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 16 +++++++++++++++- modules/generic_stage_target.py | 8 +++++--- targets/embedded/embedded-chroot.sh | 8 +++----- targets/grp/grp-chroot.sh | 3 +-- targets/livecd-stage1/livecd-stage1-chroot.sh | 4 +--- .../livecd-stage2/livecd-stage2-controller.sh | 8 +++++++- targets/livecd-stage2/unmerge.sh | 9 --------- targets/netboot/netboot-chroot.sh | 3 +-- targets/stage1/stage1-chroot.sh | 3 +-- targets/stage2/stage2-chroot.sh | 3 +-- targets/stage2/stage2-preclean-chroot.sh | 7 +++---- targets/stage3/stage3-chroot.sh | 4 +--- targets/stage3/stage3-preclean-chroot.sh | 8 +++----- targets/stage4/stage4-chroot.sh | 2 -- targets/stage4/stage4-controller.sh | 8 +++++++- targets/stage4/unmerge.sh | 9 --------- targets/support/chroot-functions.sh | 4 ++++ targets/support/pre-kmerge.sh | 3 ++- targets/support/unmerge.sh | 13 +++++++++++++ targets/tinderbox/tinderbox-chroot.sh | 7 +++---- 20 files changed, 71 insertions(+), 59 deletions(-) delete mode 100644 targets/livecd-stage2/unmerge.sh delete mode 100644 targets/stage4/unmerge.sh create mode 100644 targets/support/unmerge.sh diff --git a/ChangeLog b/ChangeLog index f24a9732..5269ad78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.435 2005/12/08 14:48:58 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.436 2005/12/08 15:16:48 rocket Exp $ + + 08 Dec 2005; Eric Edgar + modules/generic_stage_target.py, targets/embedded/embedded-chroot.sh, + targets/grp/grp-chroot.sh, targets/livecd-stage1/livecd-stage1-chroot.sh, + targets/livecd-stage2/livecd-stage2-controller.sh, + -targets/livecd-stage2/unmerge.sh, targets/netboot/netboot-chroot.sh, + targets/stage1/stage1-chroot.sh, targets/stage2/stage2-chroot.sh, + targets/stage2/stage2-preclean-chroot.sh, targets/stage3/stage3-chroot.sh, + targets/stage3/stage3-preclean-chroot.sh, targets/stage4/stage4-chroot.sh, + targets/stage4/stage4-controller.sh, -targets/stage4/unmerge.sh, + targets/support/chroot-functions.sh, targets/support/pre-kmerge.sh, + +targets/support/unmerge.sh, targets/tinderbox/tinderbox-chroot.sh: + move unmerge.sh to support;move the CLEAN_DELAY,EMERGE_WARNING_DELAY, and + CONFIG_PROTECT stuff in the run_emerge function for cleanliness 08 Dec 2005; Chris Gianelloni catalyst, files/catalyst.1: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index c7b59ba4..16f3b057 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.91 2005/12/07 21:01:35 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.92 2005/12/08 15:16:48 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -1015,8 +1015,10 @@ class generic_stage_target(generic_target): #before cleaning, unmerge stuff: try: - cmd("/bin/bash "+self.settings["sharedir"]+"/targets/" \ - +self.settings["target"]+"/unmerge.sh "+myunmerge,"Unmerge script failed.",env=self.env) + cmd("/bin/bash "+self.settings["controller_file"]+" unmerge "+ myunmerge,\ + "Unmerge script failed.",env=self.env) + #cmd("/bin/bash "+self.settings["sharedir"]+"/targets/" \ + # +self.settings["target"]+"/unmerge.sh "+myunmerge,"Unmerge script failed.",env=self.env) print "unmerge shell script" except CatalystError: self.unbind() diff --git a/targets/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh index 22ced748..429365a6 100755 --- a/targets/embedded/embedded-chroot.sh +++ b/targets/embedded/embedded-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.17 2005/11/29 20:30:42 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.18 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -15,7 +15,6 @@ setup_myemergeopts # setup the environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" #export clst_myemergeopts="${clst_myemergeopts} -O" export USE="${clst_use}" export DESTROOT=${clst_root_path} @@ -29,6 +28,5 @@ run_emerge "${clst_myemergeopts}" -o "${clst_embedded_packages}" export clst_root_path=${DESTROOT} export clst_myemergeopts="${clst_myemergeopts} -1 -O" -INSTALL_MASK="${clst_install_mask}" run_emerge "${clst_embedded_packages}" - - +export INSTALL_MASK="${clst_install_mask}" +run_emerge "${clst_embedded_packages}" diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh index 8eaea929..39e223b5 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-chroot.sh,v 1.22 2005/11/29 20:30:42 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-chroot.sh,v 1.23 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -16,7 +16,6 @@ setup_myfeatures # setup the environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" ## START BUILD setup_portage diff --git a/targets/livecd-stage1/livecd-stage1-chroot.sh b/targets/livecd-stage1/livecd-stage1-chroot.sh index b5f84dd9..fc00cd13 100755 --- a/targets/livecd-stage1/livecd-stage1-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.20 2005/12/07 21:33:43 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.21 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -14,8 +14,6 @@ setup_myemergeopts ## setup the environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" -export EMERGE_WARNING_DELAY=0 ## START BUILD setup_portage diff --git a/targets/livecd-stage2/livecd-stage2-controller.sh b/targets/livecd-stage2/livecd-stage2-controller.sh index dc94b260..f4fe2442 100755 --- a/targets/livecd-stage2/livecd-stage2-controller.sh +++ b/targets/livecd-stage2/livecd-stage2-controller.sh @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.16 2005/11/30 21:34:03 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/livecd-stage2-controller.sh,v 1.17 2005/12/08 15:16:48 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh @@ -111,6 +111,12 @@ case $1 in ${clst_sharedir}/targets/support/bootloader-setup.sh $1 ;; + + unmerge) + shift + export clst_packages="$*" + exec_in_chroot ${clst_sharedir}/targets/support/unmerge.sh + ;; target_image_setup) shift diff --git a/targets/livecd-stage2/unmerge.sh b/targets/livecd-stage2/unmerge.sh deleted file mode 100644 index 4c98a58a..00000000 --- a/targets/livecd-stage2/unmerge.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage2/Attic/unmerge.sh,v 1.10 2005/12/07 21:57:59 wolf31o2 Exp $ - -${clst_CHROOT} ${clst_chroot_path} /bin/bash << EOF - EMERGE_WARNING_DELAY=0 emerge -C $* -EOF - -exit 0 diff --git a/targets/netboot/netboot-chroot.sh b/targets/netboot/netboot-chroot.sh index 8393aa44..6bc37740 100755 --- a/targets/netboot/netboot-chroot.sh +++ b/targets/netboot/netboot-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-chroot.sh,v 1.2 2005/07/05 21:53:41 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/netboot-chroot.sh,v 1.3 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh update_env_settings @@ -12,7 +12,6 @@ setup_myemergeopts # setup our environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" export USE_ORDER="env:pkg:conf:defaults" # START BUILD diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index a5695441..4ce3a658 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.38 2005/12/07 21:33:43 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.39 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -19,7 +19,6 @@ export clst_buildpkgs="$(/tmp/build.py)" export STAGE1_USE="$(portageq envvar STAGE1_USE)" export USE="-* build ${STAGE1_USE}" export FEATURES="${clst_myfeatures} nodoc noman noinfo" -export EMERGE_WARNING_DELAY=0 ## Sanity check profile if [ -z "${clst_buildpkgs}" ] diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index 7ae088c2..193df8c3 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.16 2005/12/07 21:33:43 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.17 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -13,7 +13,6 @@ setup_myemergeopts ## setup the environment export FEATURES="${clst_myfeatures} nodoc noman noinfo" -export EMERGE_WARNING_DELAY=0 if [ "${clst_VERBOSE}" ] then diff --git a/targets/stage2/stage2-preclean-chroot.sh b/targets/stage2/stage2-preclean-chroot.sh index ebae84ff..8103aa7d 100755 --- a/targets/stage2/stage2-preclean-chroot.sh +++ b/targets/stage2/stage2-preclean-chroot.sh @@ -1,21 +1,20 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-preclean-chroot.sh,v 1.7 2005/08/09 19:02:31 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-preclean-chroot.sh,v 1.8 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh update_env_settings -export CONFIG_PROTECT="-*" if [ -n "${clst_CCACHE}" ] then - emerge -C dev-util/ccache || exit 1 + run_emerge -C dev-util/ccache || exit 1 fi if [ -n "${clst_DISTCC}" ] then - emerge -C sys-devel/distcc || exit 1 + run_emerge -C sys-devel/distcc || exit 1 fi rm -f /var/log/emerge.log diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index d2ae6af7..a6828631 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.23 2005/12/07 21:33:43 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.24 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh check_portage_version @@ -14,9 +14,7 @@ setup_myemergeopts # setup the build environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" export USE="${USE} ${clst_HOSTUSE}" -export EMERGE_WARNING_DELAY=0 ## START BUILD # portage needs to be merged manually with USE="build" set to avoid frying our diff --git a/targets/stage3/stage3-preclean-chroot.sh b/targets/stage3/stage3-preclean-chroot.sh index d44a8897..39f8762b 100755 --- a/targets/stage3/stage3-preclean-chroot.sh +++ b/targets/stage3/stage3-preclean-chroot.sh @@ -1,21 +1,19 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-preclean-chroot.sh,v 1.7 2005/08/09 19:02:31 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-preclean-chroot.sh,v 1.8 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh update_env_settings -export CONFIG_PROTECT="-*" - if [ -n "${clst_CCACHE}" ] then - emerge -C dev-util/ccache || exit 1 + run_emerge -C dev-util/ccache || exit 1 fi if [ -n "${clst_DISTCC}" ] then - emerge -C sys-devel/distcc || exit 1 + run_emerge -C sys-devel/distcc || exit 1 fi rm -f /var/log/emerge.log diff --git a/targets/stage4/stage4-chroot.sh b/targets/stage4/stage4-chroot.sh index 4a94fd7e..5bd3848c 100755 --- a/targets/stage4/stage4-chroot.sh +++ b/targets/stage4/stage4-chroot.sh @@ -12,7 +12,6 @@ setup_myemergeopts ## setup the environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" ## START BUILD setup_portage @@ -21,7 +20,6 @@ export USE_ORDER="env:pkg:conf:defaults" echo "Bringing system up to date using profile specific use flags" export USE="${USE} ${clst_HOSTUSE}" -export EMERGE_WARNING_DELAY=0 run_emerge -u system diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh index 45613632..58f4ff81 100755 --- a/targets/stage4/stage4-controller.sh +++ b/targets/stage4/stage4-controller.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.10 2005/11/30 21:34:03 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/stage4-controller.sh,v 1.11 2005/12/08 15:16:48 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh @@ -64,6 +64,12 @@ case $1 in #${clst_sharedir}/targets/livecd-stage2/livecd-stage2-cdfs.sh ${clst_sharedir}/targets/support/target_image_setup.sh $1 ;; + + unmerge) + shift + export clst_packages="$*" + exec_in_chroot ${clst_sharedir}/targets/support/unmerge.sh + ;; iso) diff --git a/targets/stage4/unmerge.sh b/targets/stage4/unmerge.sh deleted file mode 100644 index 649d11e6..00000000 --- a/targets/stage4/unmerge.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage4/Attic/unmerge.sh,v 1.2 2005/07/05 21:53:41 wolf31o2 Exp $ - -${clst_CHROOT} ${clst_chroot_path} /bin/bash << EOF - EMERGE_WARNING_DELAY=0 emerge -C $* -EOF - -exit 0 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index 8114ee90..77d5a4bc 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -151,6 +151,10 @@ run_emerge() { # with no options ROOT=/ make_destpath ${clst_root_path} + export EMERGE_WARNING_DELAY=0 + export CLEAN_DELAY=0 + export CONFIG_PROTECT="-*" + if [ -n "${clst_VERBOSE}" ] then echo "ROOT=${ROOT} emerge ${clst_myemergeopts} -vpt $@" || exit 1 diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh index 394fcb47..e8ee8127 100755 --- a/targets/support/pre-kmerge.sh +++ b/targets/support/pre-kmerge.sh @@ -7,7 +7,8 @@ . /etc/profile -CONFIG_PROTECT="-*" USE="livecd" emerge --oneshot genkernel +export USE="livecd" +run_emerge --oneshot genkernel install -d /usr/portage/packages/gk_binaries diff --git a/targets/support/unmerge.sh b/targets/support/unmerge.sh new file mode 100644 index 00000000..ee4a4b9e --- /dev/null +++ b/targets/support/unmerge.sh @@ -0,0 +1,13 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/unmerge.sh,v 1.1 2005/12/08 15:16:48 rocket Exp $ + + +source /tmp/chroot-functions.sh + +check_portage_version +update_env_settings + +run_emerge -C "${clst_packages}" + +exit 0 diff --git a/targets/tinderbox/tinderbox-chroot.sh b/targets/tinderbox/tinderbox-chroot.sh index ebabfc69..55a5b870 100755 --- a/targets/tinderbox/tinderbox-chroot.sh +++ b/targets/tinderbox/tinderbox-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/tinderbox-chroot.sh,v 1.14 2005/11/22 20:36:18 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/tinderbox-chroot.sh,v 1.15 2005/12/08 15:16:48 rocket Exp $ . /tmp/chroot-functions.sh @@ -11,7 +11,6 @@ setup_myfeatures # setup the environment export FEATURES="${clst_myfeatures}" -export CONFIG_PROTECT="-*" # START THE BUILD setup_portage @@ -26,7 +25,7 @@ for x in ${clst_tinderbox_packages} do if [ -n "${clst_VERBOSE}" ] then - emerge --usepkg --buildpkg --newuse -vp $x + run_emerge --usepkg --buildpkg --newuse -vp $x echo "Press any key within 15 seconds to pause the build..." read -s -t 15 -n 1 if [ $? -eq 0 ] @@ -38,7 +37,7 @@ do mkdir -p /tmp/packages/$x export PORT_LOGDIR="/tmp/packages/$x" - emerge --usepkg --buildpkg --newuse $x + run_emerge --usepkg --buildpkg --newuse $x if [ "$?" != "0" ] then -- 2.26.2