Fix broken stream conversion logic.

Stream system repo packages were ignored if there were no stream non-system
packages present.
This commit is contained in:
Peter Ajamian 2021-11-11 22:16:13 +13:00
parent d7e4c072a2
commit 230cbc507b

View File

@ -732,7 +732,8 @@ package_swaps() {
done done
# CentOS Stream specific processing # CentOS Stream specific processing
if (( ${#installed_stream_repos_pkgs[@]} )); then if (( ${#installed_stream_repos_pkgs[@]} ||
${#installed_sys_stream_repos_pkgs[@]} )); then
# Get a list of the repo files. # Get a list of the repo files.
local -a repos_files local -a repos_files
readarray -t repos_files < <( readarray -t repos_files < <(
@ -741,10 +742,13 @@ package_swaps() {
grep '^/etc/yum\.repos\.d/.\+\.repo$' grep '^/etc/yum\.repos\.d/.\+\.repo$'
) )
# Remove the package from the rpm db. if (( ${#installed_sys_stream_repos_pkgs[@]} )); then
saferpm -e --justdb --nodeps -a "${installed_sys_stream_repos_pkgs[@]}" || # Remove the package from the rpm db.
saferpm -e --justdb --nodeps -a \
"${installed_sys_stream_repos_pkgs[@]}" ||
exit_message \ exit_message \
"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
# Rename the stream repos with a prefix. # Rename the stream repos with a prefix.
sed -i 's/^\[/['"$stream_prefix"'/' "${repos_files[@]}" sed -i 's/^\[/['"$stream_prefix"'/' "${repos_files[@]}"