fix: apk download

This commit is contained in:
Nezumi-2711
2026-03-17 10:34:16 +07:00
parent 03625a35d5
commit 5785b1594a
2 changed files with 28 additions and 6 deletions
+2
View File
@@ -6,3 +6,5 @@ test*
/logs
build.md
cmpr
utils-refer.sh
+26 -6
View File
@@ -280,16 +280,36 @@ get_patch_last_supported_ver() {
return
fi
fi
if ! op=$(java -jar "$rv_cli_jar" list-versions "$rv_patches_jar" -f "$pkg_name" 2>&1 | tail -n +3 | awk '{$1=$1}1'); then
epr "list-versions: '$op'"
return 1
fi
op=$(patches_list_versions "$rv_cli_jar" "$rv_patches_jar" "$pkg_name") || return 1
op=$(tail -n +3 <<<"$op" | awk '{$1=$1}1')
if [ "$op" = "Any" ]; then return; fi
pcount=$(head -1 <<<"$op") pcount=${pcount#*(} pcount=${pcount% *}
if [ -z "$pcount" ]; then abort "unreachable: '$pcount'"; fi
if [ -z "$pcount" ]; then abort "No patches found for '$pkg_name' in patches '$rv_patches_jar'"; fi
grep -F "($pcount patch" <<<"$op" | sed 's/ (.* patch.*//' | get_highest_ver || return 1
}
patches_list_versions() {
local cli_jar=$1 patches_jar=$2 pkg_name=$3 op
if ! op=$(java -jar "$cli_jar" list-versions -p "$patches_jar" -f "$pkg_name" -b 2>&1); then
if ! op=$(java -jar "$cli_jar" list-versions "$patches_jar" -f "$pkg_name" 2>&1); then
epr "Could not list versions $cli_jar: '$op'"
return 1
fi
fi
echo "$op"
}
patches_list() {
local cli_jar=$1 patches_jar=$2 pkg_name=$3 op
if ! op=$(java -jar "$cli_jar" list-patches -p "$patches_jar" --filter-package-name "$pkg_name" --versions --packages -b 2>&1); then
if ! op=$(java -jar "$cli_jar" list-patches --patches "$patches_jar" -f "$pkg_name" --with-versions --with-packages 2>&1); then
epr "Could not get patches list $cli_jar: '$op'"
return 1
fi
fi
echo "$op"
}
isoneof() {
local i=$1 v
shift
@@ -555,7 +575,7 @@ build_rv() {
return 0
fi
local list_patches
list_patches=$(java -jar "$rv_cli_jar" list-patches "$rv_patches_jar" -f "$pkg_name" -v -p 2>&1)
list_patches=$(patches_list "$rv_cli_jar" "$rv_patches_jar" "$pkg_name") || return 1
local get_latest_ver=false
if [ "$version_mode" = auto ]; then