diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index 846f2b9..4d70c64 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -569,11 +569,18 @@ $'because continuing with the migration could cause further damage to system.' ) # Map the known module name differences. + disable_modules=() + local i gl repl mod for i in "${!enabled_modules[@]}"; do + mod=${enabled_modules[$i]} for gl in "${!module_glob_map[@]}"; do repl=${module_glob_map[$gl]} - enabled_modules[$i]=${enabled_modules[$i]/$gl/$repl} + mod=${mod/$gl/$repl} done + if [[ $mod != ${enabled_modules[$i]} ]]; then + disable_modules+=(${enabled_modules[$i]}) + enabled_modules[$i]=$mod + fi done # Remove entries matching any excluded modules. @@ -765,6 +772,12 @@ EOF fi fi + if (( ${#disable_modules[@]} )); then + infomsg $'Disabling modules\n\n' + safednf -y module disable "${disable_modules[@]}" || + exit_message "Can't disable modules ${disable_modules[*]}" + fi + if (( ${#enabled_modules[@]} )); then infomsg $'Enabling modules\n\n' safednf -y module enable "${enabled_modules[@]}" ||