grp srcset enhancement, ccache should now work
authorDaniel Robbins <drobbins@gentoo.org>
Tue, 10 Feb 2004 00:14:33 +0000 (00:14 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Tue, 10 Feb 2004 00:14:33 +0000 (00:14 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@208 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst
modules/targets.py
targets/grp/grp.sh

index de65cabf33f0f822a1e6aa56ce101773ef25bdba..cd4f1065b6d559684a6172d4bd7bc434a8bdcc88 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -59,8 +59,7 @@ except ImportError:
 targetmap={}
 targets.register(targetmap)
 
-if "ccache" in string.split(myspec["options"]):
-       myspec["CCACHE"]="1"
+myspec["CCACHE"]="1"
        print "Compiler cache support enabled."
 if "pkgcache" in string.split(myspec["options"]):
        print "Package cache support enabled."
index c99f9e8daf5707c8377904bf23c086898007bbfe..1ae3a8fe2fd70535f56da2953924a8b2c289891b 100644 (file)
@@ -108,12 +108,14 @@ class generic_stage_target(generic_target):
                                ccdir=os.environ["CCACHE_DIR"]
                                del os.environ["CCACHE_DIR"]
                        else:
-                               ccdir="/var/tmp/portage/ccache"
+                               ccdir="/root/.ccache"
                        if not os.path.isdir(ccdir):
                                        raise CatalystError,"Compiler cache support can't be enabled (can't find "+ccdir+")"
-                       self.mounts.append("/var/tmp/portage/ccache")
-                       self.mountmap["/var/tmp/portage/ccache"]=ccdir
-               
+                       self.mounts.append("/var/tmp/ccache")
+                       self.mountmap["/var/tmp/ccache"]=ccdir
+                       #for the chroot:
+                       os.environ["CCACHE_DIR"]="/var/tmp/ccache"      
+
                if self.settings["target"]=="grp":
                        self.mounts.append("/tmp/grp")
                        self.mountmap["/tmp/grp"]=self.settings["target_path"]
@@ -221,8 +223,6 @@ class generic_stage_target(generic_target):
                destpath=self.settings["chroot_path"]
                
                cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*"]
-               if self.settings.has_key("CCACHE"):
-                       cleanables.append("/var/cache/ccache/*")
                if self.settings["target"] not in ["livecd-stage2"]:
                        #we don't need to clean up a livecd-stage2
                        cleanables.append("/usr/portage")
index d1342825d03af832bda558ed0ffcc4f96d23a364..9b1f4da9120e1373e9f3df0e773d3e6bdeae2fcd 100755 (executable)
@@ -1,6 +1,6 @@
 # Copyright 1999-2003 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.5 2004/01/29 21:53:22 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.6 2004/02/10 00:14:33 drobbins Exp $
 
 case $1 in
 enter)
@@ -45,9 +45,17 @@ run)
                export PKGDIR="/tmp/grp/$clst_grp_target"
                emerge --usepkg --buildpkg --noreplace $clst_grp_packages || exit 1
        else
+               unset DISTDIR
+               #first grab to the normal distdir
+               emerge --fetchonly $clst_grp_packages || exit 1
                export DISTDIR="/tmp/grp/$clst_grp_target"
-               unset PKGDIR
+               export OLD_MIRRORS="\$GENTOO_MIRRORS\"
+               export GENTOO_MIRRORS="/usr/portage/distfiles"
+               #now grab them again, but with /usr/portage/distfiles as the primary mirror (local grab)
                emerge --fetchonly $clst_grp_packages || exit 1
+               #restore original GENTOO_MIRRORS setting, if any
+               export GENTOO_MIRRORS="\$OLD_MIRRORS"
+               unset PKGDIR
        fi
 EOF
        [ $? -ne 0 ] && exit 1