2020-02-20 20:07:28 +00:00
|
|
|
# Copyright 2020 Clayton Craft
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
|
def list(args):
|
|
|
|
"""
|
2017-10-16 20:01:21 +00:00
|
|
|
Get all UIs, for which aports are available with their description.
|
|
|
|
|
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]
|
2018-01-07 03:55:27 +00:00
|
|
|
ret.append((ui, apkbuild["pkgdesc"]))
|
2017-07-24 20:55:55 +00:00
|
|
|
return ret
|