forked from Mirror/pmbootstrap
pmbootstrap init: only display UIs for device arch (MR 1937)
Hide user interfaces that are not available for the selected device's architecture. Closes #1790
This commit is contained in:
parent
2d2ab1df56
commit
0ff9c5d471
6 changed files with 55 additions and 7 deletions
|
@ -5,15 +5,17 @@ import glob
|
|||
import pmb.parse
|
||||
|
||||
|
||||
def list(args):
|
||||
def list(args, arch):
|
||||
"""
|
||||
Get all UIs, for which aports are available with their description.
|
||||
|
||||
:param arch: device architecture, for which the UIs must be available
|
||||
:returns: [("none", "No graphical..."), ("weston", "Wayland reference...")]
|
||||
"""
|
||||
ret = [("none", "No graphical environment")]
|
||||
for path in sorted(glob.glob(args.aports + "/main/postmarketos-ui-*")):
|
||||
apkbuild = pmb.parse.apkbuild(args, path + "/APKBUILD")
|
||||
ui = os.path.basename(path).split("-", 2)[2]
|
||||
ret.append((ui, apkbuild["pkgdesc"]))
|
||||
if pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch):
|
||||
ret.append((ui, apkbuild["pkgdesc"]))
|
||||
return ret
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue