summaryrefslogtreecommitdiff
path: root/src/engine/SCons
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Sig/MD5.py8
-rw-r--r--src/engine/SCons/Sig/MD5Tests.py6
-rw-r--r--src/engine/SCons/Sig/TimeStamp.py7
-rw-r--r--src/engine/SCons/Sig/TimeStampTests.py6
-rw-r--r--src/engine/SCons/Sig/__init__.py2
5 files changed, 15 insertions, 14 deletions
diff --git a/src/engine/SCons/Sig/MD5.py b/src/engine/SCons/Sig/MD5.py
index 9806cf01..4004e233 100644
--- a/src/engine/SCons/Sig/MD5.py
+++ b/src/engine/SCons/Sig/MD5.py
@@ -33,11 +33,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import md5
import string
-def current(obj, sig):
- """Return whether a given object is up-to-date with the
- specified signature.
+def current(new, old):
+ """Return whether a new signature is up-to-date with
+ respect to an old signature.
"""
- return obj.get_signature() == sig
+ return new == old
def hexdigest(s):
"""Return a signature as a string of hex characters.
diff --git a/src/engine/SCons/Sig/MD5Tests.py b/src/engine/SCons/Sig/MD5Tests.py
index 0b08b01d..641dcb02 100644
--- a/src/engine/SCons/Sig/MD5Tests.py
+++ b/src/engine/SCons/Sig/MD5Tests.py
@@ -57,9 +57,9 @@ class MD5TestCase(unittest.TestCase):
Simple comparison of different "signature" values.
"""
obj = my_obj('111')
- assert not current(obj, signature(my_obj('110')))
- assert current(obj, signature(my_obj('111')))
- assert not current(obj, signature(my_obj('112')))
+ assert not current(obj.get_signature(), signature(my_obj('110')))
+ assert current(obj.get_signature(), signature(my_obj('111')))
+ assert not current(obj.get_signature(), signature(my_obj('112')))
def test_collect(self):
"""Test collecting a list of signatures into a new signature value
diff --git a/src/engine/SCons/Sig/TimeStamp.py b/src/engine/SCons/Sig/TimeStamp.py
index fa9088ca..b786a3de 100644
--- a/src/engine/SCons/Sig/TimeStamp.py
+++ b/src/engine/SCons/Sig/TimeStamp.py
@@ -30,10 +30,11 @@ utility.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-def current(obj, sig):
- """Return whether the objects timestamp is up-to-date.
+def current(new, old):
+ """Return whether a new timestamp is up-to-date with
+ respect to an old timestamp.
"""
- return obj.get_signature() >= sig
+ return not old is None and new <= old
def collect(signatures):
"""
diff --git a/src/engine/SCons/Sig/TimeStampTests.py b/src/engine/SCons/Sig/TimeStampTests.py
index 7d63235e..b158c425 100644
--- a/src/engine/SCons/Sig/TimeStampTests.py
+++ b/src/engine/SCons/Sig/TimeStampTests.py
@@ -53,9 +53,9 @@ class TimeStampTestCase(unittest.TestCase):
Simple comparison of different timestamp values.
"""
o1 = my_obj(value = 111)
- assert current(o1, 110)
- assert current(o1, 111)
- assert not current(o1, 112)
+ assert not current(o1.get_signature(), 110)
+ assert current(o1.get_signature(), 111)
+ assert current(o1.get_signature(), 112)
def test_collect(self):
"""Test collecting a list of signatures into a new signature value
diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py
index b3a0ee80..964a3294 100644
--- a/src/engine/SCons/Sig/__init__.py
+++ b/src/engine/SCons/Sig/__init__.py
@@ -197,7 +197,7 @@ class Calculator:
else:
newsig = self.signature(node)
- return newsig == oldsig
+ return self.module.current(newsig, oldsig)
def write(self, nodes):
"""