ccache fixups
authorDaniel Robbins <drobbins@gentoo.org>
Mon, 2 Feb 2004 01:02:51 +0000 (01:02 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Mon, 2 Feb 2004 01:02:51 +0000 (01:02 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@199 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst
modules/targets.py

index a64a329e2f45b30ba3d1d24a70a6e73be43fcec5..f3d936c33d1422c4469d0589eeae71910331d418 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -60,10 +60,13 @@ targetmap={}
 targets.register(targetmap)
 
 if "ccache" in string.split(myspec["options"]):
-       if not os.path.exists("/root/.ccache"):
-               os.makedirs("/root/.ccache")
-       print "Compiler cache support enabled."
-       myspec["CCACHE"]="1"
+       if not os.environ.has_key["CCACHE_DIR"]:
+               print "Compiler cache support disabled (no CCACHE_DIR defined)"
+       elif not os.path.exists(os.environ["CCACHE_DIR"]):
+               print "Compiler cache support disabled (no cache found at CCACHE_DIR)"
+       else:
+               myspec["CCACHE"]="1"
+               print "Compiler cache support enabled."
 if "pkgcache" in string.split(myspec["options"]):
        print "Package cache support enabled."
        myspec["PKGCACHE"]="1"
index 622db18baf4163866435ccd4b92f310ce4c84177..2164292354cd5c60589d0a612500b522f8542318 100644 (file)
@@ -102,8 +102,8 @@ class generic_stage_target(generic_target):
                        self.mountmap["/usr/portage/packages"]=self.settings["pkgcache_path"]
 
                if self.settings.has_key("CCACHE"):
-                       self.mounts.append("/root/.ccache")
-                       self.mountmap["/root/.ccache"]="/root/.ccache"
+                       self.mounts.append(os.environ["CCACHE_DIR"])
+                       self.mountmap["/var/tmp/portage/.ccache"]=os.environ["CCACHE_DIR"]
                
                if self.settings["target"]=="grp":
                        self.mounts.append("/tmp/grp")
@@ -211,7 +211,7 @@ class generic_stage_target(generic_target):
        def clean(self):
                destpath=self.settings["chroot_path"]
                
-               cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*","/root/.ccache"]
+               cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*"]
                if self.settings["target"] not in ["livecd-stage2"]:
                        #we don't need to clean up a livecd-stage2
                        cleanables.append("/usr/portage")