Removed whitespace diffs and corrected offline logic

This commit is contained in:
Giuseppe Ragusa 2022-06-03 17:45:32 +02:00 committed by GitHub
parent 719d90d784
commit 51c387cfce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -515,6 +515,10 @@ safednf () (
# with a good one from our mirror of CentOS vault. # with a good one from our mirror of CentOS vault.
# #
check_repourl () { check_repourl () {
if [[ $offline_mode ]]; then
return 1
fi
repoinfo "$1" || return repoinfo "$1" || return
if [[ ! ${repoinfo_results[Repo-baseurl]} ]]; then if [[ ! ${repoinfo_results[Repo-baseurl]} ]]; then
return 1 return 1
@ -524,11 +528,7 @@ check_repourl () {
IFS=, read -r -a urls <<<"${repoinfo_results[Repo-baseurl]}" IFS=, read -r -a urls <<<"${repoinfo_results[Repo-baseurl]}"
local u local u
for u in "${urls[@]##*( )}"; do for u in "${urls[@]##*( )}"; do
if [[ $offline_mode ]]; then curl -sfLI "${u%% *}repodata/repomd.xml" > /dev/null && return
return 1
else
curl -sfLI "${u%% *}repodata/repomd.xml" > /dev/null && return
fi
done done
return "$(( $? ? $? : 1 ))" return "$(( $? ? $? : 1 ))"
} }
@ -1103,7 +1103,7 @@ EOF
dist_repourl_offline+=( dist_repourl_offline+=(
"--enablerepo=$k" "--enablerepo=$k"
) )
for r in "${!pkg_repo_map[@]}"; do for r in "${!pkg_repo_map[@]}"; do
if [[ $r = $k ]]; then if [[ $r = $k ]]; then
dist_repourl_offline+=( dist_repourl_offline+=(
"--setopt=$r.mirrorlist=" "--setopt=$r.mirrorlist="
@ -1112,7 +1112,7 @@ EOF
"--setopt=$r.baseurl=${rocky_repo_offline_baseurls[$r]}" "--setopt=$r.baseurl=${rocky_repo_offline_baseurls[$r]}"
) )
fi fi
done done
done done
fi fi