summaryrefslogtreecommitdiffstats
path: root/SCons/SConsign.py
diff options
context:
space:
mode:
authorAdam Gross <grossag@vmware.com>2020-11-12 13:47:47 (GMT)
committerAdam Gross <grossag@vmware.com>2020-11-12 13:47:47 (GMT)
commita28a7fed0cd8006756e0984478709aea5f9653a9 (patch)
tree0fe9f7da19d375c90494b66c77831876811048af /SCons/SConsign.py
parente90c3fc562412a8ee18e14458c2322874aafee6c (diff)
downloadSCons-a28a7fed0cd8006756e0984478709aea5f9653a9.zip
SCons-a28a7fed0cd8006756e0984478709aea5f9653a9.tar.gz
SCons-a28a7fed0cd8006756e0984478709aea5f9653a9.tar.bz2
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 8e3ebf4..78ff888 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"