aedi: `BuildTarget.update_text_file()` restores modification time after write

the primary reason for this change is to avoid update of files at build step when these files were created at configuration step
This commit is contained in:
alexey.lysiuk 2023-03-22 11:54:15 +02:00
parent 06c741fbc1
commit 7dcef1dca4
1 changed files with 4 additions and 0 deletions

View File

@ -131,9 +131,13 @@ class BuildTarget(Target):
if content == patched_content:
return
file_time = os.stat(path).st_mtime
with open(path, 'w') as f:
f.writelines(patched_content)
os.utime(path, (file_time, file_time))
@staticmethod
def _update_variables_file(path: Path, prefix_value: str,
processor: typing.Optional[typing.Callable] = None, quotes: bool = True):