Allow some generated files not to exist is bak

Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
Gilles Peskine
2025-09-17 13:09:00 +02:00
parent 302015e0d4
commit 37f6573319
+4
View File
@@ -239,6 +239,10 @@ def check_generated_files(generation_scripts: List[GenerationScript], root: Path
for file in generation_script.files:
file = root / file
bak_file = file.with_name(file.name + ".bak")
if generation_script.optional and not bak_file.exists():
# This file is optional and didn't exist before, so
# there's nothing to compare to, or clean up.
continue
if not filecmp.cmp(file, bak_file):
ref_file = file.with_name(file.name + ".ref")
ref_file = root / ref_file