From 6d21220c310a24b6dbd2686729642687f2cb3906 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Thu, 15 Jul 2021 19:16:25 +1200 Subject: [PATCH] Map OracleLinux stream names to RHEL. OracleLinux renames a nubmer of module streams from rhel8 to ol8 and from rhel to ol. This commit maps the names back to rhel8 and rhel so that migrate2rocky doesn't blow up on them. --- migrate2rocky/migrate2rocky.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index 5e3a2a2..e05bc2d 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -412,6 +412,14 @@ collect_system_info () { libselinux-python:2.8 ) + # Some OracleLinux modules have stream names of ol8 instead of rhel8 and ol + # instead of rhel. This is a map that does a glob match and replacement. + local -A module_re_map + module_glob_map=( + ['%:ol8']=:rhel8 + ['%:ol']=:rhel + ); + # We need to map rockylinux repository names to the equivalent repositories # in the source distro. To do that we look for known packages in each # repository and see what repo they came from. We need to use repoquery for @@ -559,6 +567,15 @@ $'because continuing with the migration could cause further damage to system.' ' | sort -u set +e +o pipefail ) + + # Map the known module name differences. + for i in "${!enabled_modules[@]}"; do + for gl in "${!module_glob_map[@]}"; do + repl=${module_glob_map[$gl]} + enabled_modules[$i]=${enabled_modules[$i]/$gl/$repl} + done + done + # Remove entries matching any excluded modules. if (( ${#module_excludes[@]} )); then printf '%s\n' '' "Excluding modules:" "${module_excludes[@]}"