2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-11 20:59:03 +01:00

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

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