helpers: ui: replace args.aports with context.aports (MR 2252)

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-05-24 19:57:25 +02:00 committed by Oliver Smith
parent 66c1d20f8e
commit 1371525c2b
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -2,8 +2,10 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import os
import glob
from pmb.core import get_context
from pmb.core.types import PmbArgs
import pmb.helpers.pmaports
import pmb.helpers.package
import pmb.parse
@ -16,7 +18,8 @@ def list_ui(args: PmbArgs, arch):
ret = [("none", "Bare minimum OS image for testing and manual"
" customization. The \"console\" UI should be selected if"
" a graphical UI is not desired.")]
for path in sorted(args.aports.glob("main/postmarketos-ui-*")):
context = get_context() # noqa: F821
for path in sorted(context.aports.glob("main/postmarketos-ui-*")):
apkbuild = pmb.parse.apkbuild(path)
ui = os.path.basename(path).split("-", 2)[2]
if pmb.helpers.package.check_arch(args, apkbuild["pkgname"], arch):