Skip to content

Commit 4e957b7

Browse files
committed
desktops: use armbian-config --status filter; mark CSC in dialog
The configng API landed two orthogonal catalog filters: --filter (computed availability) and --status (editorial status keep-list). Push the EXPERT-mode policy server-side: default: --status supported EXPERT: --status supported,community unsupported DEs are never offered from the build dialog — they're vendor-specific (bianbu) and only reachable via armbian-config on a running system, not baked into an image. Also rename the JSON field probed by the inline python from the old 'supported' to 'available' (the configng rename), and replace the generic '[status]' label suffix with a '[CSC]' marker on community DEs.
1 parent f2b2344 commit 4e957b7

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

lib/functions/configuration/config-desktop.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,41 @@ function interactive_desktop_main_configuration() {
4646
"armbian-config clone may be incomplete"
4747
fi
4848

49+
# EXPERT mode controls which editorial `status:` values are
50+
# surfaced in the dialog:
51+
# default: `status: supported` only
52+
# EXPERT: `status: supported` + `status: community` (CSC)
53+
# `status: unsupported` DEs are never offered from the build
54+
# dialog — they're vendor-specific (e.g. bianbu on riscv64)
55+
# and only reachable via `armbian-config --api` on a running
56+
# system, not baked into an image.
57+
local status_filter="supported"
58+
[[ "${EXPERT}" == "yes" ]] && status_filter="supported,community"
59+
4960
local de_json
50-
de_json=$(python3 "${parser}" "${yaml_dir}" --list-json "${RELEASE}" "${ARCH}" 2>/dev/null)
51-
if [[ -z "${de_json}" ]]; then
61+
de_json=$(python3 "${parser}" "${yaml_dir}" --list-json \
62+
"${RELEASE}" "${ARCH}" --status "${status_filter}" 2>/dev/null)
63+
if [[ -z "${de_json}" || "${de_json}" == "[]" ]]; then
5264
exit_with_error "No desktop environments available for ${RELEASE}/${ARCH}" \
5365
"Parser returned an empty list"
5466
fi
5567

56-
# Build dialog options from the JSON output. Only show
57-
# `status: supported` DEs unless EXPERT mode is on.
68+
# Build dialog options from the JSON output. Server-side
69+
# `--filter available` (the parser default) guarantees only
70+
# DEs whose YAML declares this (release, arch) reach us, and
71+
# `--status` above handles the editorial filter. Append a
72+
# " [CSC]" marker to community DEs so the user can tell them
73+
# apart from first-class supported ones at a glance.
5874
local -a options=()
5975
while IFS=$'\t' read -r de_name de_desc de_status; do
6076
[[ -z "${de_name}" ]] && continue
61-
if [[ "${de_status}" != "supported" && "${EXPERT}" != "yes" ]]; then
62-
continue
63-
fi
6477
local label="${de_desc}"
65-
[[ "${de_status}" != "supported" ]] && label="${de_desc} [${de_status}]"
78+
[[ "${de_status}" == "community" ]] && label="${de_desc} [CSC]"
6679
options+=("${de_name}" "${label}")
6780
done < <(echo "${de_json}" | python3 -c "
6881
import sys, json
6982
for de in json.load(sys.stdin):
70-
if de.get('supported'):
71-
print(de.get('name','') + '\t' + de.get('description','') + '\t' + de.get('status',''))
83+
print(de.get('name','') + '\t' + de.get('description','') + '\t' + de.get('status',''))
7284
" 2>/dev/null)
7385

7486
if [[ "${#options[@]}" -eq 0 ]]; then

0 commit comments

Comments
 (0)