pmb.config.init: Improve message when "Archived:" header is missing (MR 2535)

This changes the output from e.g.

    WARNING: xiaomi-markw is archived: None

to

    WARNING: xiaomi-markw is archived: No reason given (this is a bug)

which I think is better and makes it clear that this is not behaviour
one should rely upon. All archived ports should have a reason given, but
this has not been (and still isn't as I'm writing this) enforced in
pmaports, so we can't rely on there being one.

Related: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6085
This commit is contained in:
Newbyte 2025-01-25 16:05:47 +01:00
parent 21ab1b3c20
commit 86aec42713
No known key found for this signature in database
GPG key ID: ACD854892B38D898

View file

@ -490,7 +490,7 @@ def ask_for_device(context: Context) -> tuple[str, bool, str]:
pmb.aportgen.generate(f"linux-{device}", False)
elif any("archived" == x for x in device_path.parts):
apkbuild = device_path.parent / "APKBUILD"
archived = pmb.parse._apkbuild.archived(apkbuild)
archived = pmb.parse._apkbuild.archived(apkbuild) or "No reason given (this is a bug)"
logging.info(f"WARNING: {device} is archived: {archived}")
if not pmb.helpers.cli.confirm():
continue