fix(frame): fix dnf install use iaas mirror instead of official

This commit is contained in:
2026-04-21 13:29:58 +08:00
parent 0f28c4b255
commit 2eb798ff2b

View File

@@ -101,11 +101,12 @@ function DNF_INSTALL() {
if [[ location == "local" ]]; then
reponames=$(grep '^\[.*\]' /etc/yum.repos.d/*.repo | tr -d [] | sed -e ':a;N;$!ba;s/\n/ /g')
mapfile -t __install_pkgs < <(dnf --assumeno install ${__pkg_list[*]} 2>&1 | grep -wE "${reponames// /|}" | grep -wE "$(uname -m)|noarch" | awk '{print $1}')
dnf -y install ${__pkg_list[*]}
if ! dnf -y install ${__pkg_list[*]}; then
LOG_ERROR "pkg_list:${__pkg_list[*]} install failed."
exit 1
if ! dnf -y install --repo=mirror.iscas.ac.cn ${__pkg_list[*]}; then
LOG_WARN "Install with mirror.iscas.ac.cn failed, retrying with default repos."
if ! dnf -y install ${__pkg_list[*]}; then
LOG_ERROR "pkg_list:${__pkg_list[*]} install failed."
exit 1
fi
fi
else
remoteIp=$[ "NODE"$node"_IPV4" ]