feat: Encapsulate edition ordering policy (#2023)

This commit is contained in:
Kroese
2026-07-29 19:29:55 +02:00
committed by GitHub
parent f487122f80
commit 033a06a3df
2 changed files with 49 additions and 32 deletions
+45 -29
View File
@@ -38,35 +38,6 @@ USERNAME=$(strip "$USERNAME")
DOMAIN_OU=$(strip "$DOMAIN_OU")
WORKGROUP=$(strip "$WORKGROUP")
EDITION_ORDER=(
"-enterprise|enterprise|enterprise enterprise-*"
"-ultimate|ultimate|ultimate ultimate-*"
"|default|@default n pro pro-* professional professional-* business business-*"
"-iot|iot|iot iot-* enterprise-iot enterprise-iot-*"
"-ltsc|ltsc|ltsc ltsc-* enterprise-ltsc enterprise-ltsc-*"
"-education|education|education education-* pro-education pro-education-*"
"-home|home|home home-*"
"-home-premium|home|home-premium home-premium-*"
"-home-basic|home|home-basic home-basic-*"
"-starter|starter|starter starter-*"
)
SERVER_EDITION_ORDER=(
"|default|@default"
"-datacenter|datacenter|datacenter datacenter-*"
"-datacenter-azure|datacenter|datacenter-azure"
"-enterprise|enterprise|enterprise enterprise-*"
"-web|web|web web-*"
"-foundation|foundation|foundation foundation-*"
"-essentials|essentials|essentials essentials-*"
"-standard-core|standard-core|standard-core standard-core-*"
"-datacenter-core|datacenter-core|datacenter-core datacenter-core-*"
"-datacenter-azure-core|datacenter-core|datacenter-azure-core"
"-enterprise-core|enterprise-core|enterprise-core enterprise-core-*"
"-web-core|web-core|web-core web-core-*"
"-hv|hv|hv hv-*"
)
MIRRORS=4
parseVersion() {
@@ -928,6 +899,51 @@ getServerEditionID() {
return 0
}
getEditionOrder() {
local id="${1,,}"
local result_name="$2"
local -n result="$result_name"
result=()
case "$id" in
"win20"* )
result=(
"|default|@default"
"-datacenter|datacenter|datacenter datacenter-*"
"-datacenter-azure|datacenter|datacenter-azure"
"-enterprise|enterprise|enterprise enterprise-*"
"-web|web|web web-*"
"-foundation|foundation|foundation foundation-*"
"-essentials|essentials|essentials essentials-*"
"-standard-core|standard-core|standard-core standard-core-*"
"-datacenter-core|datacenter-core|datacenter-core datacenter-core-*"
"-datacenter-azure-core|datacenter-core|datacenter-azure-core"
"-enterprise-core|enterprise-core|enterprise-core enterprise-core-*"
"-web-core|web-core|web-core web-core-*"
"-hv|hv|hv hv-*"
)
;;
* )
result=(
"-enterprise|enterprise|enterprise enterprise-*"
"-ultimate|ultimate|ultimate ultimate-*"
"|default|@default n pro pro-* professional professional-* business business-*"
"-iot|iot|iot iot-* enterprise-iot enterprise-iot-*"
"-ltsc|ltsc|ltsc ltsc-* enterprise-ltsc enterprise-ltsc-*"
"-education|education|education education-* pro-education pro-education-*"
"-home|home|home home-*"
"-home-premium|home|home-premium home-premium-*"
"-home-basic|home|home-basic home-basic-*"
"-starter|starter|starter starter-*"
)
;;
esac
return 0
}
getVersion() {
local id edition