mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-24 14:11:24 +00:00
Merge branch 'rocky-linux:main' into patch-1
This commit is contained in:
commit
faf4738bc2
@ -44,6 +44,8 @@ if (( BASH_VERSINFO[0]*100 + BASH_VERSINFO[1] < 402 )); then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
shopt -s extglob
|
||||||
|
|
||||||
# Make sure we're root.
|
# Make sure we're root.
|
||||||
if (( EUID != 0 )); then
|
if (( EUID != 0 )); then
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
@ -269,6 +271,10 @@ pre_check () {
|
|||||||
'migrate2rocky. See the README file for details.'
|
'migrate2rocky. See the README file for details.'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnf -y check || exit_message \
|
||||||
|
'Errors found in dnf/rpm database. Please correct before running '\
|
||||||
|
'migrate2rocky.'
|
||||||
|
|
||||||
# Get available space to compare to requirements.
|
# Get available space to compare to requirements.
|
||||||
# If the stock kernel is not installed we don't require space in /boot
|
# If the stock kernel is not installed we don't require space in /boot
|
||||||
if ! rpm -q --quiet kernel; then
|
if ! rpm -q --quiet kernel; then
|
||||||
@ -436,6 +442,7 @@ _repoinfo () {
|
|||||||
# We now store the repoinfo results in a cache.
|
# We now store the repoinfo results in a cache.
|
||||||
declare -g -A repoinfo_results_cache=()
|
declare -g -A repoinfo_results_cache=()
|
||||||
repoinfo () {
|
repoinfo () {
|
||||||
|
local k
|
||||||
if [[ ! ${repoinfo_results_cache[$1]} ]]; then
|
if [[ ! ${repoinfo_results_cache[$1]} ]]; then
|
||||||
_repoinfo "$@" || return
|
_repoinfo "$@" || return
|
||||||
repoinfo_results_cache[$1]=1
|
repoinfo_results_cache[$1]=1
|
||||||
@ -512,9 +519,13 @@ check_repourl () {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -sfLI "${repoinfo_results[Repo-baseurl]%% *}repodata/repomd.xml" \
|
local -a urls;
|
||||||
> /dev/null
|
IFS=, read -r -a urls <<<"${repoinfo_results[Repo-baseurl]}"
|
||||||
return
|
local u
|
||||||
|
for u in "${urls[@]##*( )}"; do
|
||||||
|
curl -sfLI "${u%% *}repodata/repomd.xml" > /dev/null && return
|
||||||
|
done
|
||||||
|
return "$(( $? ? $? : 1 ))"
|
||||||
}
|
}
|
||||||
|
|
||||||
collect_system_info () {
|
collect_system_info () {
|
||||||
@ -639,6 +650,7 @@ collect_system_info () {
|
|||||||
|
|
||||||
# ...and finally set a number of dnf options to replace the baseurl of these
|
# ...and finally set a number of dnf options to replace the baseurl of these
|
||||||
# repos
|
# repos
|
||||||
|
local k
|
||||||
for k in "${!dist_repourl_map[@]}"; do
|
for k in "${!dist_repourl_map[@]}"; do
|
||||||
local d=${k%%:*} r=${k#*:}
|
local d=${k%%:*} r=${k#*:}
|
||||||
if [[ $d != "$dist_id" || ! ${enabled_repo_check[$r]} ]] ||
|
if [[ $d != "$dist_id" || ! ${enabled_repo_check[$r]} ]] ||
|
||||||
|
Loading…
Reference in New Issue
Block a user