diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Sig/__init__.py | 13 |
4 files changed, 20 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 3283760..6e92bb7 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -44,6 +44,9 @@ RELEASE 0.XX - XXX - Provide helpful error messages when the arguments to env.Install() are incorrect. + - Fix the value returned by the Node.prevsiginfo() method to conform + to a previous change when checking whether a node is current. + From Christoph Wiedemann - Have the g++ Tool actually use g++ in preference to c++. diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 103cfae..2d6e0bc 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -971,6 +971,13 @@ class NodeTestCase(unittest.TestCase): assert n.get_subst_proxy() == n, n.get_subst_proxy() + def test_get_prevsiginfo(self): + """Test the base Node get_prevsiginfo() method""" + n = SCons.Node.Node() + siginfo = n.get_prevsiginfo() + assert siginfo == (None, None, None), siginfo + + if __name__ == "__main__": suite = unittest.makeSuite(NodeTestCase, 'test_') diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 6947c93..1a80d5a 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -513,7 +513,7 @@ class Node: def get_prevsiginfo(self): """Fetch the previous signature information from the .sconsign entry.""" - return None + return SCons.Sig._SConsign.null_siginfo def get_timestamp(self): return 0 diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 36145cb..b4b70b4 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -103,6 +103,11 @@ class _SConsign: global sig_files sig_files.append(self) + # A null .sconsign entry. We define this here so that it will + # be easy to keep this in sync if/whenever we change the type of + # information returned by the get() method, below. + null_siginfo = (None, None, None) + def get(self, filename): """ Get the .sconsign entry for a file @@ -321,15 +326,15 @@ class Calculator: return csig if self.max_drift >= 0: - info = node.get_prevsiginfo() + oldtime, oldbsig, oldcsig = node.get_prevsiginfo() else: - info = None + oldtime, oldbsig, oldcsig = _SConsign.null_siginfo mtime = node.get_timestamp() - if (info and info[0] and info[2] and info[0] == mtime): + if (oldtime and oldcsig and oldtime == mtime): # use the signature stored in the .sconsign file - csig = info[2] + csig = oldcsig # Set the csig here so it doesn't get recalculated unnecessarily # and so it's set when the .sconsign file gets written cache.set_csig(csig) |