2021-01-07 22:30:30 +00:00
|
|
|
# Copyright 2021 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
|
|
|
"""
|
2018-01-07 03:55:27 +00:00
|
|
|
ret = [("none", "No graphical environment")]
|
2017-10-16 20:01:21 +00:00
|
|
|
for path in sorted(glob.glob(args.aports + "/main/postmarketos-ui-*")):
|
|
|
|
apkbuild = pmb.parse.apkbuild(args, 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
|