summaryrefslogtreecommitdiff
path: root/SCons/SConsign.py
diff options
context:
space:
mode:
authorAdam Gross <grossag@vmware.com>2020-11-12 08:47:47 -0500
committerAdam Gross <grossag@vmware.com>2020-11-12 08:47:47 -0500
commita28a7fed0cd8006756e0984478709aea5f9653a9 (patch)
tree0fe9f7da19d375c90494b66c77831876811048af /SCons/SConsign.py
parente90c3fc562412a8ee18e14458c2322874aafee6c (diff)
downloadscons-git-a28a7fed0cd8006756e0984478709aea5f9653a9.tar.gz
Change the default sconsign DB file name if the hash is overridden
This was requested in the code review. The sconsign database file name is still .sconsign.dblite if the hash format is not overridden, but if it is, the name will be something like .sconsign_sha256.dblite.
Diffstat (limited to 'SCons/SConsign.py')
-rw-r--r--SCons/SConsign.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/SCons/SConsign.py b/SCons/SConsign.py
index 8e3ebf4d7..78ff88890 100644
--- a/SCons/SConsign.py
+++ b/SCons/SConsign.py
@@ -52,12 +52,20 @@ sig_files = []
# extension the underlying DB module will add).
DataBase = {}
DB_Module = SCons.dblite
-DB_Name = ".sconsign"
+DB_Name = None
DB_sync_list = []
def Get_DataBase(dir):
global DataBase, DB_Module, DB_Name
+
+ if DB_Name is None:
+ hash_format = SCons.Util.get_hash_format()
+ if hash_format is None:
+ DB_Name = ".sconsign"
+ else:
+ DB_Name = ".sconsign_%s" % hash_format
+
top = dir.fs.Top
if not os.path.isabs(DB_Name) and top.repositories:
mode = "c"