From 2a29d3bfd1626cbbaeb53aa83bfcd11e05d7963d Mon Sep 17 00:00:00 2001 From: stevenknight Date: Mon, 21 Jul 2003 05:05:04 +0000 Subject: [PATCH] Fix the return value of the base Node.get_prevsiginfo(). (Gary Oberbrunner) git-svn-id: http://scons.tigris.org/svn/scons/trunk@739 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 3 +++ src/engine/SCons/Node/NodeTests.py | 7 +++++++ src/engine/SCons/Node/__init__.py | 2 +- 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 3283760b..6e92bb72 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 103cfae3..2d6e0bce 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 6947c935..1a80d5af 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 36145cb5..b4b70b4c 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) -- 2.26.2