From 5b15a56502bdb918e819e055832acb59b3a5113c Mon Sep 17 00:00:00 2001 From: Andrey Petelin Date: Thu, 25 Sep 2025 11:43:03 +0500 Subject: [PATCH] fix: Add local declaration for lowest variable and improve opkg status error redirection spacing --- podkop/files/usr/lib/helpers.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/podkop/files/usr/lib/helpers.sh b/podkop/files/usr/lib/helpers.sh index ecb3b29..aa94339 100644 --- a/podkop/files/usr/lib/helpers.sh +++ b/podkop/files/usr/lib/helpers.sh @@ -53,7 +53,9 @@ is_min_package_version() { local current="$1" local required="$2" + local lowest lowest="$(printf '%s\n' "$current" "$required" | sort -V | head -n1)" + [ "$lowest" = "$required" ] } @@ -130,7 +132,7 @@ get_ruleset_format_by_file_extension() { get_package_version() { local package="$1" - opkg status "$package" 2>/dev/null | awk '/^Version:/ {print $2}' | cut -d'-' -f1 + opkg status "$package" 2> /dev/null | awk '/^Version:/ {print $2}' | cut -d'-' -f1 } # Converts a comma-separated string into a JSON array string