pmb.helpers.devices: Use get_device_category_by_directory_path()

Simplifies the code slightly.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2616
This commit is contained in:
Newbyte 2025-06-03 12:52:44 +02:00 committed by Oliver Smith
parent 89a80265de
commit b21c545956
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -121,7 +121,7 @@ def list_codenames(vendor: str) -> list[DeviceEntry]:
codename = os.path.basename(path).split("-", 1)[1]
# Ensure we don't crash on unknown device categories.
try:
category = get_device_category_by_apkbuild_path(path / "APKBUILD")
category = get_device_category_by_directory_path(path)
except RuntimeError as exception:
logging.warning("WARNING: %s: %s", codename, exception)
continue