diff options
author | Tom Tanner <ttanner2@bloomberg.net> | 2013-10-01 10:38:32 (GMT) |
---|---|---|
committer | Tom Tanner <ttanner2@bloomberg.net> | 2013-10-01 10:38:32 (GMT) |
commit | 56875f9b7463ebb9cd1478187d9cd3ca25fd40d2 (patch) | |
tree | b60aee19c8130396fb3757fad129f66193aec129 /src | |
parent | 01f45ca84f2b1c9f2b8113e09a270503ab8581e0 (diff) | |
download | SCons-56875f9b7463ebb9cd1478187d9cd3ca25fd40d2.zip SCons-56875f9b7463ebb9cd1478187d9cd3ca25fd40d2.tar.gz SCons-56875f9b7463ebb9cd1478187d9cd3ca25fd40d2.tar.bz2 |
support for --cache-readonly
Setting this will fetch data from the cache but won't update it.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/CacheDir.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Script/Main.py | 1 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConsOptions.py | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index 3516018..9dd18e5 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -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()) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 837c103..fea0916 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -1089,6 +1089,7 @@ def _build_targets(fs, options, targets, target_top): SCons.Node.FS.set_diskcheck(options.diskcheck) SCons.CacheDir.cache_enabled = not options.cache_disable + SCons.CacheDir.cache_readonly = options.cache_readonly SCons.CacheDir.cache_debug = options.cache_debug SCons.CacheDir.cache_force = options.cache_force SCons.CacheDir.cache_show = options.cache_show diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index c1f389a..62033ba 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -564,6 +564,11 @@ def Parser(version): action="store_true", help="Copy already-built targets into the CacheDir.") + op.add_option('--cache-readonly', + dest='cache_readonly', default=False, + action="store_true", + help="Do not update CacheDir with built targets.") + op.add_option('--cache-show', dest='cache_show', default=False, action="store_true", @@ -579,8 +584,10 @@ def Parser(version): if not value in c_options: raise OptionValueError(opt_invalid('config', value, c_options)) setattr(parser.values, option.dest, value) + opt_config_help = "Controls Configure subsystem: %s." \ % ", ".join(config_options) + op.add_option('--config', nargs=1, type="string", dest="config", default="auto", |