feat: Improve LTSC and IoT edition handling (#1926)

This commit is contained in:
Kroese
2026-07-21 17:27:54 +02:00
committed by GitHub
parent 49135eb09e
commit 377337a625
12 changed files with 136 additions and 83 deletions
+17 -3
View File
@@ -672,15 +672,29 @@ hasVersion() {
local id="$1"
local tag="$2"
local xml="$3"
local edition
local edition alternate=""
[ ! -f "/run/assets/$id.xml" ] && return 1
edition=$(printEdition "$id" "")
[ -z "$edition" ] && return 1
[[ "${xml,,}" != *"<${tag,,}>${edition,,}</${tag,,}>"* ]] && return 1
return 0
[[ "${xml,,}" == *"<${tag,,}>${edition,,}</${tag,,}>"* ]] && return 0
case "${id,,}" in
*"-iot" | *"-iot-eval" )
alternate="${id/-iot/-ltsc}" ;;
*"-ltsc" | *"-ltsc-eval" )
alternate="${id/-ltsc/-iot}" ;;
* ) return 1 ;;
esac
edition=$(printEdition "$alternate" "")
[ -z "$edition" ] && return 1
[[ "${xml,,}" == *"<${tag,,}>${edition,,}</${tag,,}>"* ]] && return 0
return 1
}
selectVersion() {