Skip to content

Commit 37f6573

Browse files
Allow some generated files not to exist is bak
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
1 parent 302015e commit 37f6573

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/make_generated_files.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ def check_generated_files(generation_scripts: List[GenerationScript], root: Path
239239
for file in generation_script.files:
240240
file = root / file
241241
bak_file = file.with_name(file.name + ".bak")
242+
if generation_script.optional and not bak_file.exists():
243+
# This file is optional and didn't exist before, so
244+
# there's nothing to compare to, or clean up.
245+
continue
242246
if not filecmp.cmp(file, bak_file):
243247
ref_file = file.with_name(file.name + ".ref")
244248
ref_file = root / ref_file

0 commit comments

Comments
 (0)