diff options
author | Steven Knight <knight@baldmt.com> | 2005-05-30 15:12:12 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-05-30 15:12:12 (GMT) |
commit | 4c3581902665e0584739cd744853725911740491 (patch) | |
tree | ddc2a21e9dba79aa4452a3dda71cefca7e1e6140 /src | |
parent | f5d37d48553e04629fb7f6feac6e3b6c2243ee65 (diff) | |
download | SCons-4c3581902665e0584739cd744853725911740491.zip SCons-4c3581902665e0584739cd744853725911740491.tar.gz SCons-4c3581902665e0584739cd744853725911740491.tar.bz2 |
Handle Repositories without an SConsignFile() in them.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/SConsign.py | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py index 9b5c420..cbe0b8c 100644 --- a/src/engine/SCons/SConsign.py +++ b/src/engine/SCons/SConsign.py @@ -40,8 +40,6 @@ import SCons.Node import SCons.Sig import SCons.Warnings -from SCons.Debug import Trace - def corrupt_dblite_warning(filename): SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%filename) @@ -163,9 +161,12 @@ class DB(Base): db, mode = Get_DataBase(dir) - tpath = norm_entry(dir.tpath) + # Read using the path relative to the top of the Repository + # (self.dir.tpath) from which we're fetching the signature + # information. + path = norm_entry(dir.tpath) try: - rawentries = db[tpath] + rawentries = db[path] except KeyError: pass else: @@ -191,17 +192,26 @@ class DB(Base): sig_files.append(self) def write(self, sync=1): - if self.dirty: - db, mode = Get_DataBase(self.dir) - db[norm_entry(self.dir.tpath)] = cPickle.dumps(self.entries, 1) - if sync: - try: - syncmethod = db.sync - except AttributeError: - # Not all anydbm modules have sync() methods. - pass - else: - syncmethod() + if not self.dirty: + return + + db, mode = Get_DataBase(self.dir) + + # Write using the path relative to the top of the SConstruct + # directory (self.dir.path), not relative to the top of + # the Repository; we only write to our own .sconsign file, + # not to .sconsign files in Repositories. + path = norm_entry(self.dir.path) + db[path] = cPickle.dumps(self.entries, 1) + + if sync: + try: + syncmethod = db.sync + except AttributeError: + # Not all anydbm modules have sync() methods. + pass + else: + syncmethod() class Dir(Base): def __init__(self, fp=None, module=None): |