fix: download apk

This commit is contained in:
Nezumi-2711
2026-03-16 18:38:24 +07:00
parent e8297c8d9a
commit ffa6e7a357
2 changed files with 11 additions and 9 deletions
+7
View File
@@ -67,6 +67,7 @@ for table_name in $(toml_get_table_names); do
vtf "$enabled" "enabled" vtf "$enabled" "enabled"
if [ "$enabled" = false ]; then continue; fi if [ "$enabled" = false ]; then continue; fi
if ((idx >= PARALLEL_JOBS)); then if ((idx >= PARALLEL_JOBS)); then
echo "[DEBUG] wait -n at top of loop for $table_name" >&2
wait -n wait -n
idx=$((idx - 1)) idx=$((idx - 1))
fi fi
@@ -80,6 +81,7 @@ for table_name in $(toml_get_table_names); do
if ! RVP="$(get_rv_prebuilts "$cli_src" "$cli_ver" "$patches_src" "$patches_ver")"; then if ! RVP="$(get_rv_prebuilts "$cli_src" "$cli_ver" "$patches_src" "$patches_ver")"; then
abort "could not download rv prebuilts" abort "could not download rv prebuilts"
fi fi
echo "[DEBUG] get_rv_prebuilts done for $table_name, RVP='$RVP'" >&2
read -r rv_cli_jar rv_patches_jar <<<"$RVP" read -r rv_cli_jar rv_patches_jar <<<"$RVP"
app_args[cli]=$rv_cli_jar app_args[cli]=$rv_cli_jar
app_args[ptjar]=$rv_patches_jar app_args[ptjar]=$rv_patches_jar
@@ -93,6 +95,7 @@ for table_name in $(toml_get_table_names); do
fi fi
fi fi
if [ "${app_args[riplib]}" = "true" ] && [ "$(toml_get "$t" riplib)" = "false" ]; then app_args[riplib]=false; fi if [ "${app_args[riplib]}" = "true" ] && [ "$(toml_get "$t" riplib)" = "false" ]; then app_args[riplib]=false; fi
echo "[DEBUG] riplib check done for $table_name, riplib=${app_args[riplib]}" >&2
app_args[rv_brand]=$(toml_get "$t" rv-brand) || app_args[rv_brand]=$DEF_RV_BRAND app_args[rv_brand]=$(toml_get "$t" rv-brand) || app_args[rv_brand]=$DEF_RV_BRAND
app_args[excluded_patches]=$(toml_get "$t" excluded-patches) || app_args[excluded_patches]="" app_args[excluded_patches]=$(toml_get "$t" excluded-patches) || app_args[excluded_patches]=""
@@ -141,11 +144,13 @@ for table_name in $(toml_get_table_names); do
module_prop_name_b=${app_args[module_prop_name]} module_prop_name_b=${app_args[module_prop_name]}
app_args[module_prop_name]="${module_prop_name_b}-arm64" app_args[module_prop_name]="${module_prop_name_b}-arm64"
idx=$((idx + 1)) idx=$((idx + 1))
echo "[DEBUG] Launching build_rv for $table_name (arm64-v8a)" >&2
build_rv "$(declare -p app_args)" & build_rv "$(declare -p app_args)" &
app_args[table]="$table_name (arm-v7a)" app_args[table]="$table_name (arm-v7a)"
app_args[arch]="arm-v7a" app_args[arch]="arm-v7a"
app_args[module_prop_name]="${module_prop_name_b}-arm" app_args[module_prop_name]="${module_prop_name_b}-arm"
if ((idx >= PARALLEL_JOBS)); then if ((idx >= PARALLEL_JOBS)); then
echo "[DEBUG] wait -n for parallel job limit" >&2
wait -n wait -n
idx=$((idx - 1)) idx=$((idx - 1))
fi fi
@@ -158,9 +163,11 @@ for table_name in $(toml_get_table_names); do
app_args[module_prop_name]="${app_args[module_prop_name]}-arm" app_args[module_prop_name]="${app_args[module_prop_name]}-arm"
fi fi
idx=$((idx + 1)) idx=$((idx + 1))
echo "[DEBUG] Launching build_rv for $table_name" >&2
build_rv "$(declare -p app_args)" & build_rv "$(declare -p app_args)" &
fi fi
done done
echo "[DEBUG] All build_rv launched, waiting..." >&2
wait wait
rm -rf temp/tmp.* rm -rf temp/tmp.*
if [ -z "$(ls -A1 "${BUILD_DIR}")" ]; then abort "All builds failed."; fi if [ -z "$(ls -A1 "${BUILD_DIR}")" ]; then abort "All builds failed."; fi
+4 -9
View File
@@ -215,7 +215,7 @@ _req() {
local ip="$1" op="$2" local ip="$1" op="$2"
shift 2 shift 2
if [ "$op" = - ]; then if [ "$op" = - ]; then
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip" 2>/dev/null; then if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip"; then
epr "Request failed: $ip" epr "Request failed: $ip"
return 1 return 1
fi fi
@@ -227,7 +227,7 @@ _req() {
while [ -f "$dlp" ]; do sleep 1; done while [ -f "$dlp" ]; do sleep 1; done
return return
fi fi
if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip" -o "$dlp" 2>/dev/null; then if ! curl -L -c "$TEMP_DIR/cookie.txt" -b "$TEMP_DIR/cookie.txt" --connect-timeout 10 --retry 3 --retry-delay 2 --fail -s -S "$@" "$ip" -o "$dlp"; then
epr "Request failed: $ip" epr "Request failed: $ip"
return 1 return 1
fi fi
@@ -523,6 +523,7 @@ check_sig() {
build_rv() { build_rv() {
eval "declare -A args=${1#*=}" eval "declare -A args=${1#*=}"
echo "[DEBUG] build_rv entered for ${args[table]}" >&2
local version="" pkg_name="" local version="" pkg_name=""
local mode_arg=${args[build_mode]} version_mode=${args[version]} local mode_arg=${args[build_mode]} version_mode=${args[version]}
local app_name=${args[app_name]} local app_name=${args[app_name]}
@@ -541,13 +542,7 @@ build_rv() {
local tried_dl=() local tried_dl=()
for dl_p in archive apkmirror uptodown; do for dl_p in archive apkmirror uptodown; do
if [ -z "${args[${dl_p}_dlurl]}" ]; then continue; fi if [ -z "${args[${dl_p}_dlurl]}" ]; then continue; fi
local _fetch_ok=true if ! get_${dl_p}_resp "${args[${dl_p}_dlurl]}" || ! pkg_name=$(get_"${dl_p}"_pkg_name) || [ -z "$pkg_name" ]; then
if ! get_${dl_p}_resp "${args[${dl_p}_dlurl]}" 2>/dev/null; then
_fetch_ok=false
elif ! pkg_name=$(get_"${dl_p}"_pkg_name 2>/dev/null) || [ -z "$pkg_name" ]; then
_fetch_ok=false
fi
if [ "$_fetch_ok" = false ]; then
args[${dl_p}_dlurl]="" args[${dl_p}_dlurl]=""
epr "ERROR: Could not find ${table} in ${dl_p}" epr "ERROR: Could not find ${table} in ${dl_p}"
continue continue