Fix/add helpers.devices.list_{apkbuilds,deviceinfos}() (!1737)

This fixes list_apkbuilds which is dead code currently but is useful
for external software using pmbootstrap. It also adds list_deviceinfos
which does the same thing but for the deviceinfo data.

The plan is to add an API later, where both functions can be used.
This commit is contained in:
Martijn Braam 2019-01-09 01:48:25 +01:00 committed by Oliver Smith
parent 50a26dcca4
commit e468d51dae
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 11 additions and 1 deletions

View File

@ -39,6 +39,16 @@ def list_apkbuilds(args):
"""
ret = {}
for device in list(args):
apkbuild_path = args.aports + "/device-" + device + "/APKBUILD"
apkbuild_path = args.aports + "/device/device-" + device + "/APKBUILD"
ret[device] = pmb.parse.apkbuild(args, apkbuild_path)
return ret
def list_deviceinfos(args):
"""
:returns: { "first-device": {"name": ..., "screen_width": ...}, ... }
"""
ret = {}
for device in list(args):
ret[device] = pmb.parse.deviceinfo(args, device)
return ret