Added setup_myemergeopts to setup_myfeatures and removed redundant calls to setup_mye...
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 10 Apr 2007 21:28:05 +0000 (21:28 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 10 Apr 2007 21:28:05 +0000 (21:28 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1225 d1e1f19c-881f-0410-ab34-b69fee027534

15 files changed:
ChangeLog
targets/embedded/embedded-chroot.sh
targets/grp/grp-chroot.sh
targets/livecd-stage1/livecd-stage1-chroot.sh
targets/netboot/netboot-chroot.sh
targets/netboot/netboot-combine.sh
targets/netboot2/netboot2-pkg.sh
targets/stage1/stage1-chroot.sh
targets/stage1/stage1-controller.sh
targets/stage2/stage2-chroot.sh
targets/stage3/stage3-chroot.sh
targets/stage4/stage4-chroot.sh
targets/support/chroot-functions.sh
targets/support/kmerge.sh
targets/support/pre-kmerge.sh

index 1ccffd013d64140d7f1b16d184d32a5754e72745..a9d33d39a1a6b2e0723c17f749169fce0ec3a3ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,23 @@
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  10 Apr 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+  targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh,
+  targets/livecd-stage1/livecd-stage1-chroot.sh,
+  targets/netboot/netboot-chroot.sh, targets/netboot/netboot-combine.sh,
+  targets/netboot2/netboot2-pkg.sh, targets/stage1/stage1-chroot.sh,
+  targets/stage1/stage1-controller.sh, targets/stage2/stage2-chroot.sh,
+  targets/stage3/stage3-chroot.sh, targets/stage4/stage4-chroot.sh,
+  targets/support/chroot-functions.sh, targets/support/kmerge.sh,
+  targets/support/pre-kmerge.sh:
+  Added setup_myemergeopts to setup_myfeatures and removed redundant calls to
+  setup_myemergeopts. Added some extra checks for clst_FETCH to disable
+  certain functions/code paths when running with -F/--fetchonly. Simplified
+  kmerge.sh with regards to kerncache and callback packages. Also, changed
+  ccache/distcc installs to use run_emerge instead of emerge directly, which
+  allows us to more easily replace the underlying package manager, or add
+  support for multiple package managers to catalyst.
+
   20 Mar 2007; Chris Gianelloni <wolf31o2@gentoo.org> catalyst,
   modules/grp_target.py:
   Added patch from Åsmund Grammeltvedt <grammel@online.no> to add
index 11ac4ce6e491f1746254f4f4f905e4f087913dd1..e4c123dc131eb2f264a91ab17067f66bf2f028f0 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup the environment
 export FEATURES="${clst_myfeatures}"
index 0db3b61d5a49c907760fae47cfad8c3d286875f7..228b8e4a280883596e793f123589e362dea20492 100755 (executable)
@@ -23,27 +23,10 @@ then
        unset DISTDIR
        export PKGDIR="/tmp/grp/${clst_grp_target}"
 
-       if [ -n "${clst_FETCH}" ]
-       then
-               export clst_myemergeopts="${clst_myemergeopts} -f"
-       fi
-
-       if [ -n "${clst_VERBOSE}" ]
-       then
-               emerge --usepkg --buildpkg --noreplace --newuse -vp \
-                       ${clst_myemergeopts} ${clst_grp_packages} || exit 1
-               echo "Press any key within 15 seconds to pause the build..."
-               read -s -t 15 -n 1
-               if [ $? -eq 0 ]
-               then
-                       echo "Press any key to continue..."
-                       read -s -n 1
-               fi
-       fi
-       emerge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
+       run_emerge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} \
                ${clst_grp_packages} || exit 1
 else
-       DISTDIR="/tmp/grp/${clst_grp_target}" emerge --fetchonly \
+       DISTDIR="/tmp/grp/${clst_grp_target}" run_emerge --fetchonly \
                ${clst_grp_packages} || exit 1
        unset PKGDIR
 fi
index 2a562482681718d98a73c8215ac32d9e3503d885..13b2074a3abebf53076c17f70b75cd012246cd64 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup the environment
 
index 2a82b1e2d96414b728ea9a28ae4e8e3d1509c5ad..bf51a0b35d3d54b89ab0e8514509bfe91fa0ec52 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup our environment
 export FEATURES="${clst_myfeatures}"
index df5d49b2cf706a97f80d918359507374ddc3209e..8d9898b325fe61adbd871f90b82db8dd92895da3 100644 (file)
@@ -7,7 +7,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Ssetup our environment
 export FEATURES="${clst_myfeatures}"
index 2a82b1e2d96414b728ea9a28ae4e8e3d1509c5ad..bf51a0b35d3d54b89ab0e8514509bfe91fa0ec52 100644 (file)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup our environment
 export FEATURES="${clst_myfeatures}"
index e4aa826c3fc4a9c943e5a5707de49b5ba439fc32..69a51ba6cb515110bcc0bebef7a875c2a9919fb0 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup our environment
 export clst_buildpkgs="$(/tmp/build.py)"
index 6dd0f1176553d25d77890b9745b734c8f506cdcf..118561737cf07ef4fe79bd09edf3d37a6442e502 100755 (executable)
@@ -23,7 +23,7 @@ case $1 in
        ;;
        preclean)
                # Before we enter the chroot, we need to run gcc-config/binutils-config
-               if [ -x /usr/bin/gcc-config ]
+               if [ -x /usr/bin/gcc-config ] && [ -z "${clst_FETCH}" ]
                then
                        mythang=$( cd ${clst_chroot_path}/tmp/stage1root/etc/env.d/gcc; ls ${clst_CHOST}-* | head -n 1 )
                        if [ -z "${mythang}" ]
@@ -34,7 +34,7 @@ case $1 in
                        CHOST=${clst_CHOST} \
                                gcc-config ${mythang}
                fi
-               if [ -x /usr/bin/binutils-config ]
+               if [ -x /usr/bin/binutils-config ] && [ -z "${clst_FETCH}" ]
                then
                        mythang=$( cd ${clst_chroot_path}/tmp/stage1root/etc/env.d/binutils; ls ${clst_CHOST}-* | head -n 1 )
                        if [ -z "${mythang}" ]
index 0662ac734c4b652f669ca7f2efd6fdafb0abfad6..002a60515955a8ad05d1466076c14f4f1aade045 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup the environment
 export FEATURES="${clst_myfeatures} nodoc noman noinfo"
index b693eb247ec09da2682a8ad0efbe029b67a42875..55393a131449e65292f33ceb29a1d1275f38a5f1 100755 (executable)
@@ -5,15 +5,14 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup the build environment
 export FEATURES="${clst_myfeatures}"
 export USE="${USE} ${clst_HOSTUSE}"
 
 ## START BUILD
-# portage needs to be merged manually with USE="build" set to avoid frying our
-# make.conf. emerge system could merge it otherwise.
+# We need portage to be merged manually with USE="build" set to avoid frying
+# our make.conf, otherwise, the system target could take care of it.
 
 setup_portage
 
index 1575dd6a5da4d91c14ec379fc7ab9baf0b2979c8..ba9ab85ec0b51e4fa699e93ff2e98d92e9b6b4b5 100755 (executable)
@@ -5,7 +5,6 @@
 update_env_settings
 
 setup_myfeatures
-setup_myemergeopts
 
 # Setup the environment
 export FEATURES="${clst_myfeatures}"
index bd5c9d5fc2eff5b2a0a435464c70c6e74f73fcb2..ae8fbdd125ad4780f80dea20da074cfad860ff2c 100755 (executable)
@@ -35,6 +35,7 @@ check_genkernel_version(){
 }
 
 setup_myfeatures(){
+       setup_myemergeopts
        if [ -n "${clst_CCACHE}" ]
        then
                export clst_myfeatures="${clst_myfeatures} ccache"
@@ -42,7 +43,7 @@ setup_myfeatures(){
                #then
                #       echo "CCACHE Autoresume point found not emerging ccache"
                #else
-                       emerge --oneshot --nodeps -b -k ccache || exit 1
+                       run_emerge --oneshot --nodeps ccache || exit 1
                #       touch /tmp/.clst_ccache
                #fi
        fi
@@ -55,7 +56,7 @@ setup_myfeatures(){
                #then
                #       echo "DISTCC Autoresume point found not emerging distcc"
                #else
-                       USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
+                       USE="-gtk -gnome" run_emerge --oneshot --nodeps distcc || exit 1
                        #touch /tmp/.clst_distcc
                #fi
                mkdir -p /etc/distcc
index d3714f2bcd329d38b7ecc6604072337d32edaab6..490dce045796911abea9c32c8058eca6187477c8 100755 (executable)
@@ -68,23 +68,22 @@ genkernel_compile(){
        fi
        # Build with genkernel using the set options
        # callback is put here to avoid escaping issues
+       gk_callback_opts="-q"
+       PKGDIR=${PKGDIR}
        if [ -n "${clst_KERNCACHE}" ]
        then
-               if [ "$clst_kernel_merge" != "" ]
-               then
-                       genkernel --callback="PKGDIR=${PKGDIR} emerge -kqb \
-                               ${clst_kernel_merge}" ${GK_ARGS} || exit 1
-               else
-                       genkernel ${GK_ARGS} || exit 1
-               fi
+               gk_callback_opts="${gk_callback_opts} -kb"
+       fi
+       if [ -n "${clst_FETCH}" ]
+       then
+               gk_callback_opts="${gk_callback_opts} -f"
+       fi
+       if [ "${clst_kernel_merge}" != "" ]
+       then
+               genkernel --callback="emerge ${gk_callback_opts} ${clst_kernel_merge}" \
+                       ${GK_ARGS} || exit 1
        else
-               if [ "$clst_kernel_merge" != "" ]
-               then
-                       genkernel --callback="emerge -q ${clst_kernel_merge}" \
-                               ${GK_ARGS} || exit 1
-               else
-                       genkernel ${GK_ARGS} || exit 1
-               fi
+               genkernel ${GK_ARGS} || exit 1
        fi
        md5sum /var/tmp/${clst_kname}.config|awk '{print $1}' > /tmp/kerncache/${clst_kname}/${clst_kname}-${clst_version_stamp}.CONFIG
 }
@@ -98,7 +97,6 @@ build_kernel() {
 source /etc/profile
 
 setup_myfeatures
-setup_myemergeopts
 
 [ -n "${clst_ENVSCRIPT}" ] && source /tmp/envscript
 export CONFIG_PROTECT="-*"
@@ -188,7 +186,7 @@ then
                        echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
                fi
        fi
-               [ -d /usr/src/linux ] && rm /usr/src/linux
+       [ -d /usr/src/linux ] && rm /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
index 2b7544ffa1e634b2d29fbfc964537f3ec31136d3..b8805e719355aafd140ab9ec9cbb325149146615 100755 (executable)
@@ -4,6 +4,11 @@
 
 update_env_settings
 
+if [ -n "${clst_FETCH}" ]
+then
+       export clst_myemergeopts="${clst_myemergeopts} -f"
+fi
+
 case ${clst_target} in
        livecd*|stage4)
                export USE="livecd"