mirror of
https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git
synced 2023-10-10 13:37:40 +02:00
Correct firmware version list if experimental version is installed
This commit is contained in:
parent
117be79fc4
commit
3297ef76b3
@ -1192,18 +1192,32 @@ proc ::rmupdate::get_firmware_info {} {
|
||||
write_log 1 "Failed to get latest supported version from ${support_file_url}"
|
||||
return "\[\]"
|
||||
}
|
||||
|
||||
|
||||
set versions [list]
|
||||
set current [get_current_firmware_version]
|
||||
set versions [list $current]
|
||||
set experimental_version ""
|
||||
foreach e [get_available_firmware_downloads] {
|
||||
set version [get_version_from_filename $e]
|
||||
set downloads($version) $e
|
||||
if {[lsearch $versions $version] == -1} {
|
||||
if {$version != "unknown"} {
|
||||
if {$version != "unknown"} {
|
||||
set downloads($version) $e
|
||||
if {[string first "-" $version] != -1} {
|
||||
set experimental_version $version
|
||||
} elseif {[lsearch $versions $version] == -1} {
|
||||
lappend versions $version
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$experimental_version != ""} {
|
||||
if {[lsearch $versions $experimental_version] == -1} {
|
||||
set tmp [split $experimental_version "-"]
|
||||
# experimental version != latest version
|
||||
lappend versions $experimental_version
|
||||
if {[lindex $tmp 0] == $current} {
|
||||
# assuming that experimental version is installed
|
||||
set current $experimental_version
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach e [get_available_firmware_images] {
|
||||
set version [get_version_from_filename $e]
|
||||
if {$version != "unknown"} {
|
||||
@ -1213,6 +1227,9 @@ proc ::rmupdate::get_firmware_info {} {
|
||||
}
|
||||
}
|
||||
}
|
||||
if {[lsearch $versions $current] == -1} {
|
||||
lappend versions $current
|
||||
}
|
||||
set versions [lsort -decreasing -command compare_versions $versions]
|
||||
|
||||
set json "\["
|
||||
|
Loading…
x
Reference in New Issue
Block a user