Fix broken mirrorlist URLs from CentOS Stream repos.

The mirrorlist URLs rely on variable replacements from CentOS Stream that are
not valid once we have switched to Rocky Linux.  To fix this we change to the
baseurl instead and fix it up to not rely on those variables that have changed.
This commit is contained in:
Peter Ajamian 2021-11-18 14:11:15 +13:00
parent 678a220c92
commit 6c3453041c

View File

@ -741,8 +741,12 @@ package_swaps() {
"Could not remove packages from the rpm db: ${installed_sys_stream_repos_pkgs[@]}" "Could not remove packages from the rpm db: ${installed_sys_stream_repos_pkgs[@]}"
fi fi
# Rename the stream repos with a prefix. # Rename the stream repos with a prefix and fix the baseurl.
sed -i 's/^\[/['"$stream_prefix"'/' "${repos_files[@]}" sed -i \
-e 's/^\[/['"$stream_prefix"'/' \
-e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/$contentdir/$stream/|baseurl=|http://mirror.centos.org/centos/8-stream/' \
"${repos_files[@]}"
fi fi
# Use dnf shell to swap the system packages out. # Use dnf shell to swap the system packages out.