1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-25 13:35:09 +03:00

pmb: Look for device/* files in device/*/... instead (!1879)

In the future, device ports will be located in a subdirectory
below device/... (e.g. device/testing/device-...).
Replace all occurrences of device/* with a glob that checks the
subdirectories instead.

Note: To ensure that this always works properly we should also add some
checks that all devices are indeed located under one of the supported
subdirectories (i.e. testing/community/main).

Change the glob for pmaports to <aports>/**/APKBUILD.
This allows using subdirectories for organization outside of device/
as well.
This commit is contained in:
Minecrell 2020-02-26 12:13:26 +01:00 committed by Oliver Smith
parent c399ff81a1
commit fb8de5a553
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
20 changed files with 62 additions and 40 deletions

View file

@ -5,6 +5,7 @@ import glob
import os
import shutil
import pmb.aportgen
import pmb.config
import pmb.config.pmaports
import pmb.helpers.cli
@ -185,10 +186,10 @@ def ask_for_device_nonfree(args, device):
:returns: answers as dict, e.g. {"firmware": True, "userland": False}
"""
# Parse existing APKBUILD or return defaults (when called from test case)
apkbuild_path = args.aports + "/device/device-" + device + "/APKBUILD"
apkbuild_path = pmb.helpers.devices.find_path(args, device, 'APKBUILD')
ret = {"firmware": args.nonfree_firmware,
"userland": args.nonfree_userland}
if not os.path.exists(apkbuild_path):
if not apkbuild_path:
return ret
apkbuild = pmb.parse.apkbuild(args, apkbuild_path)
@ -259,8 +260,7 @@ def ask_for_device(args):
codenames)
device = vendor + '-' + codename
device_exists = os.path.exists(args.aports + "/device/device-" +
device + "/deviceinfo")
device_exists = pmb.helpers.devices.find_path(args, device, 'deviceinfo') is not None
if not device_exists:
if device == args.device:
raise RuntimeError(