diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-12 17:48:16 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-12 17:48:16 +0200 |
commit | 5691a6c506a798b49164d132608bc9d747b92180 (patch) | |
tree | 85704636c71371f118ef03370a4f5cda428f0b40 /engine/SCons/CacheDir.py | |
parent | 2fb368b8751637ffa010e5e4f79e2dda6adc6038 (diff) | |
parent | 19712e5025e3cf6a33fccd0738f04e018d55025f (diff) |
Update upstream source from tag 'upstream/3.0.5'
Update to upstream version '3.0.5'
with Debian dir 17ecf804eb411d18bf841acaaf9a2dab2b55f14d
Diffstat (limited to 'engine/SCons/CacheDir.py')
-rw-r--r-- | engine/SCons/CacheDir.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/engine/SCons/CacheDir.py b/engine/SCons/CacheDir.py index b15d715..81c74f0 100644 --- a/engine/SCons/CacheDir.py +++ b/engine/SCons/CacheDir.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 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,12 +21,13 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/CacheDir.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/CacheDir.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ CacheDir support """ +import hashlib import json import os import stat @@ -55,6 +56,10 @@ def CacheRetrieveFunc(target, source, env): fs.symlink(fs.readlink(cachefile), t.get_internal_path()) else: env.copy_from_cache(cachefile, t.get_internal_path()) + try: + os.utime(cachefile, None) + except OSError: + pass st = fs.stat(cachefile) fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) return 0 @@ -134,12 +139,6 @@ warned = dict() class CacheDir(object): def __init__(self, path): - try: - import hashlib - except ImportError: - msg = "No hashlib or MD5 module available, CacheDir() not supported" - SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg) - path = None self.path = path self.current_cache_debug = None self.debugFP = None @@ -222,7 +221,9 @@ class CacheDir(object): return None, None sig = node.get_cachedir_bsig() + subdir = sig[:self.config['prefix_len']].upper() + dir = os.path.join(self.path, subdir) return dir, os.path.join(dir, sig) |