From 32030e2301a2e2649e78428b49f87a3bf733d04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Mon, 24 May 2010 09:55:55 +0000 Subject: [PATCH] Always use /root/.ccache for CCACHE_DIR for not bypassing ccache when we modify /root in actions.py. A more elegant way is to read CCACHE_DIR from pisi.conf --- pisi/operations/build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index b6333589..7a80de34 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -311,6 +311,9 @@ class Builder: if os.path.exists("/usr/lib/ccache/bin/gcc"): # Add ccache directory for support Compiler Cache :) os.environ["PATH"] = "/usr/lib/ccache/bin/:%s" % os.environ["PATH"] + # Force ccache to use /root/.ccache instead of $HOME/.ccache which can be modified + # through actions.py + os.environ["CCACHE_DIR"] = "/root/.ccache" ctx.ui.info(_("CCache detected...")) def fetch_files(self): @@ -566,7 +569,7 @@ class Builder: # Extra path for ccache when needed if ctx.config.values.build.buildhelper == "ccache": - valid_paths.append("%s/.ccache" % os.environ["HOME"]) + valid_paths.append(os.environ.get("CCACHE_DIR", "/root/.ccache")) ret = catbox.run(self.actionLocals[func], valid_paths, logger=self.log_sandbox_violation) # Retcode can be 0 while there is a sanbox violation, so only look for violations to correctly handle it