2023-01-22 18:11:10 +00:00
|
|
|
# Copyright 2023 Clayton Craft
|
2020-02-20 20:07:28 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2017-07-24 20:55:55 +00:00
|
|
|
import os
|
|
|
|
import glob
|
2017-10-16 20:01:21 +00:00
|
|
|
import pmb.parse
|
2017-07-24 20:55:55 +00:00
|
|
|
|
|
|
|
|
2020-05-14 10:20:11 +00:00
|
|
|
def list(args, arch):
|
2017-07-24 20:55:55 +00:00
|
|
|
"""
|
2017-10-16 20:01:21 +00:00
|
|
|
Get all UIs, for which aports are available with their description.
|
|
|
|
|
2020-05-14 10:20:11 +00:00
|
|
|
:param arch: device architecture, for which the UIs must be available
|
2018-01-07 03:55:27 +00:00
|
|
|
:returns: [("none", "No graphical..."), ("weston", "Wayland reference...")]
|
2017-07-24 20:55:55 +00:00
|
|
|
"""
|
2021-12-10 17:49:33 +00:00
|
|
|
ret = [("none", "Bare minimum OS image for testing and manual"
|
|
|
|
" customization. The \"console\" UI should be selected if"
|
|
|
|
" a graphical UI is not desired.")]
|
2017-10-16 20:01:21 +00:00
|
|
|
for path in sorted(glob.glob(args.aports + "/main/postmarketos-ui-*")):
|
2021-11-09 11:52:10 +00:00
|
|
|
apkbuild = pmb.parse.apkbuild(f"{path}/APKBUILD")
|
2017-07-24 20:55:55 +00:00
|
|
|
ui = os.path.basename(path).split("-", 2)[2]
|
2020-05-14 10:20:11 +00:00
|
|
|
if pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch):
|
|
|
|
ret.append((ui, apkbuild["pkgdesc"]))
|
2017-07-24 20:55:55 +00:00
|
|
|
return ret
|