fix: avoid apk lock conflict by running install_pkg synchronously on Alpine

This commit is contained in:
rowanchen-com
2026-03-21 18:02:17 +08:00
parent c3512eb1a0
commit 9d35760dbf

View File

@@ -73,7 +73,7 @@ is_sh_dir=$is_core_dir/sh
is_sh_repo=$author/$is_core is_sh_repo=$author/$is_core
is_pkg="wget tar bash" is_pkg="wget tar bash"
# Alpine: gcompat provides glibc compatibility for prebuilt binaries # Alpine: gcompat provides glibc compatibility for prebuilt binaries
[[ $cmd =~ apk ]] && is_pkg="$is_pkg gcompat" [[ $cmd =~ apk ]] && is_pkg="$is_pkg gcompat jq"
is_config_json=$is_core_dir/config.json is_config_json=$is_core_dir/config.json
tmp_var_lists=( tmp_var_lists=(
tmpcore tmpcore
@@ -352,17 +352,17 @@ main() {
fi fi
# install dependent pkg # install dependent pkg
if [[ $cmd =~ apk ]]; then
install_pkg $is_pkg
else
install_pkg $is_pkg & install_pkg $is_pkg &
fi
# jq # jq
if [[ $(type -P jq) ]]; then if [[ $(type -P jq) ]]; then
>$is_jq_ok >$is_jq_ok
else else
jq_not_found=1 jq_not_found=1
# Alpine: install jq via apk instead of downloading glibc binary
[[ $cmd =~ apk ]] && {
apk add jq &>/dev/null && jq_not_found= && >$is_jq_ok
}
fi fi
# if wget installed. download core, sh, jq, get ip # if wget installed. download core, sh, jq, get ip
[[ $is_wget ]] && { [[ $is_wget ]] && {