diff --git a/generate-recipe.py b/generate-recipe.py index a83376f..13e965c 100755 --- a/generate-recipe.py +++ b/generate-recipe.py @@ -3,6 +3,7 @@ import re import sys import subprocess +from pathlib import Path # pylint: disable=invalid-name @@ -18,12 +19,23 @@ if version not in ["1", "2", "3", "4"]: sys.exit(1) suite = sys.argv[2] -if suite not in ['bullseye', 'bookworm', 'trixie']: +if suite not in ['bullseye', 'bookworm', 'trixie', 'forky']: print("E: unsupported suite %s" % suite, file=sys.stderr) sys.exit(1) target_yaml = 'raspi_%s_%s.yaml' % (version, suite) +### Detect unsupported combinations +# +# Some version/suite combinations are no longer supported (e.g. the architecture +# got removed from the archive), in which case generate an empty file and let +# the Makefile pick it up from there. +if version == '1' and suite in ['forky']: + print(f'W: generating an empty recipe for unsupported combination ({version}×{suite})') + Path(target_yaml).write_text('') + sys.exit(0) + + ### Setting variables based on suite and version starts here # Arch, kernel, DTB: