summaryrefslogtreecommitdiff
path: root/engine/SCons/CacheDir.py
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2014-04-26 11:52:25 +0200
committerLuca Falavigna <dktrkranz@debian.org>2014-04-26 11:52:25 +0200
commit599d55e3999ad29f72fdc3a61d7c4bafc3171452 (patch)
tree9192ad293f1b2bb4d8b57a45660b5f2da69700df /engine/SCons/CacheDir.py
parentcc58c8587a4e67f389b00e5d3278fae049ac7399 (diff)
Imported Upstream version 2.3.1upstream/2.3.1
Diffstat (limited to 'engine/SCons/CacheDir.py')
-rw-r--r--engine/SCons/CacheDir.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/engine/SCons/CacheDir.py b/engine/SCons/CacheDir.py
index aef03b4..8ac8fa9 100644
--- a/engine/SCons/CacheDir.py
+++ b/engine/SCons/CacheDir.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/CacheDir.py 2013/03/03 09:48:35 garyo"
+__revision__ = "src/engine/SCons/CacheDir.py 2014/03/02 14:18:15 garyo"
__doc__ = """
CacheDir support
@@ -37,6 +37,7 @@ cache_enabled = True
cache_debug = False
cache_force = False
cache_show = False
+cache_readonly = False
def CacheRetrieveFunc(target, source, env):
t = target[0]
@@ -70,6 +71,8 @@ CacheRetrieve = SCons.Action.Action(CacheRetrieveFunc, CacheRetrieveString)
CacheRetrieveSilent = SCons.Action.Action(CacheRetrieveFunc, None)
def CachePushFunc(target, source, env):
+ if cache_readonly: return
+
t = target[0]
if t.nocache:
return
@@ -150,6 +153,9 @@ class CacheDir(object):
def is_enabled(self):
return (cache_enabled and not self.path is None)
+ def is_readonly(self):
+ return cache_readonly
+
def cachepath(self, node):
"""
"""
@@ -201,7 +207,7 @@ class CacheDir(object):
return False
def push(self, node):
- if not self.is_enabled():
+ if self.is_readonly() or not self.is_enabled():
return
return CachePush(node, [], node.get_build_env())