mirror of
https://github.com/osixia/container-openldap.git
synced 2026-11-06 12:40:36 -04:00
fix(upgrade): detect downgrades at minor and patch levels
version_lt kept the whole version as a single array element, so the arithmetic comparison failed and the function always returned false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7ce0c43309
commit
a762bda77d
@@ -14,7 +14,9 @@ extract_version() {
|
||||
|
||||
version_lt() {
|
||||
local IFS=.
|
||||
local -a v1=("$1") v2=("$2")
|
||||
local -a v1 v2
|
||||
read -ra v1 <<< "$1"
|
||||
read -ra v2 <<< "$2"
|
||||
for i in 0 1 2; do
|
||||
local a=${v1[i]:-0} b=${v2[i]:-0}
|
||||
(( 10#$a < 10#$b )) && return 0
|
||||
|
||||
Reference in New Issue
Block a user