ccache should work now
authorDaniel Robbins <drobbins@gentoo.org>
Tue, 3 Feb 2004 05:51:31 +0000 (05:51 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Tue, 3 Feb 2004 05:51:31 +0000 (05:51 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@202 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst
modules/targets.py

index 4a5a724fc872731e9d8ecf35c6d67a4cc6a69f20..de65cabf33f0f822a1e6aa56ce101773ef25bdba 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -60,13 +60,8 @@ targetmap={}
 targets.register(targetmap)
 
 if "ccache" in string.split(myspec["options"]):
-       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."
+       myspec["CCACHE"]="1"
+       print "Compiler cache support enabled."
 if "pkgcache" in string.split(myspec["options"]):
        print "Package cache support enabled."
        myspec["PKGCACHE"]="1"
index 38b5771c9aefe9aee92d836633505f25c13112e6..959ff174a7fba16f459c95866407eba301a9f92c 100644 (file)
@@ -102,8 +102,15 @@ class generic_stage_target(generic_target):
                        self.mountmap["/usr/portage/packages"]=self.settings["pkgcache_path"]
 
                if self.settings.has_key("CCACHE"):
-                       self.mounts.append(os.environ["CCACHE_DIR"])
-                       self.mountmap["/var/tmp/portage/.ccache"]=os.environ["CCACHE_DIR"]
+                       if os.environ.has_key("CCACHE_DIR"):
+                               ccdir=os.environ["CCACHE_DIR"]
+                               del os.environ["CCACHE_DIR"]
+                       else:
+                               ccdir="/var/tmp/portage/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
                
                if self.settings["target"]=="grp":
                        self.mounts.append("/tmp/grp")