Preserve modification time for is_copy=True

This commit is contained in:
Jan Niklas Hasse 2017-05-12 14:05:18 +02:00 committed by ita1024
parent b639668c3b
commit 73e7568165
1 changed files with 2 additions and 0 deletions

View File

@ -715,6 +715,8 @@ class subst_pc(Task.Task):
if getattr(self.generator, 'is_copy', None):
for i, x in enumerate(self.outputs):
x.write(self.inputs[i].read('rb'), 'wb')
stat = os.stat(self.inputs[i].abspath()) # Preserve mtime of the copy
os.utime(self.outputs[i].abspath(), (stat.st_atime, stat.st_mtime))
self.force_permissions()
return None