Use the module-specific current() function.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 9 Oct 2001 19:26:25 +0000 (19:26 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 9 Oct 2001 19:26:25 +0000 (19:26 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@91 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Sig/MD5.py
src/engine/SCons/Sig/MD5Tests.py
src/engine/SCons/Sig/TimeStamp.py
src/engine/SCons/Sig/TimeStampTests.py
src/engine/SCons/Sig/__init__.py

index 9806cf01ac26ca8144166f192e7c3690781ffd50..4004e233eedf41c7c6aaf7db58c177edb2bf3e80 100644 (file)
@@ -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.
index 0b08b01d7082097d9891f22c3e11a97c1e2c357b..641dcb0282f6403a071265f1cff51e8c9223b6d8 100644 (file)
@@ -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
index fa9088cae4badef1892c06d2aec6a2ea756e56c7..b786a3defe1f1c24cb69f5eee9464ca843df949c 100644 (file)
@@ -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):
     """
index 7d63235ee172dee207061dc029d6b4f7bcf94010..b158c4253c457977ee333de6469b53f15e4b3866 100644 (file)
@@ -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
index b3a0ee80fc325f955b1c3b7343ca1fc9368f4911..964a3294a43bccef1630c0913f90035693ddd89f 100644 (file)
@@ -197,7 +197,7 @@ class Calculator:
         else:
             newsig = self.signature(node)
         
-        return newsig == oldsig
+        return self.module.current(newsig, oldsig)
 
     def write(self, nodes):
         """