Commits

Matteo Bertini committed 7d25969

Fix bug with +CHECKEXISTS option

Comments (0)

Files changed (1)

         self._order_only = not self.commands
     def is_outdated(self):
         newest_dep = max([mtime(dep) for dep in self.deps]+[0])
-        oldest_target = min([(mtime(target) if target not in self._check_exists else newest_dep) for target in self.targets])
+        # if target in _check_exists: -> rebuild only if missing
+        def target_timestamp(target):
+            timestamp = mtime(target)
+            if timestamp < 0:
+                return timestamp
+            else:
+                return timestamp if target not in self._check_exists else newest_dep
+        oldest_target = min([target_timestamp(target) for target in self.targets])
         if oldest_target < newest_dep:
             return True
         else: