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
1 changed files with 7 additions and 3 deletions

View File

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