From 6957c0c4dd3bbe71eea1d91d8e332fa41c30c492 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Mon, 21 Jun 2021 06:54:44 +1200 Subject: [PATCH 1/2] Add shellcheck directives Some commands trigger false positives in shellcheck. Add directives to tell shellcheck not to complain about them. --- migrate2rocky/migrate2rocky.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index 6213ec7..3f0e290 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -63,6 +63,7 @@ logfile=/var/log/migrate2rocky.log # Output to 4 just goes to stderr. # Output to 5 just goes to the logfile. truncate -s0 "$logfile" +# shellcheck disable=SC2094 exec \ 3>&1 \ 4>&2 \ @@ -82,6 +83,7 @@ msg_format () { _var="$1" shift if (( $# > 1 )); then + # shellcheck disable=SC2059 printf -v "$_var" "$@" else printf -v "$_var" "%s" "$1" @@ -277,6 +279,7 @@ repoinfo () { # it won't appear in a .repo file on a line by itself, so it's safe to # search for the string to make the awk parser look all the way to the end # of the file. + # shellcheck disable=SC2154 repoinfo_results[Repo-gpgkey]=$( awk ' $0=="['"${repoinfo_results[Repo-id]}"']",$0=="end_of_file" { @@ -290,6 +293,7 @@ repoinfo () { # Add an indicator of whether this is a subscription-manager managed # repository. + # shellcheck disable=SC2154 repoinfo_results[Repo-managed]=$( awk ' BEGIN {FS="[)(]"} From d9b0081501e2279d0aa5645915f4f4c79144ad85 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Tue, 22 Jun 2021 03:06:16 +1200 Subject: [PATCH 2/2] Fix issue with migration from Oracle 8.4 Oracle 8.4 moved some files from their oraclelinux-release package to a new package named redhat-release. This update makes sure to remove redhat-release as well as the other packages during migration to avoid conflicts with rocky-release. --- migrate2rocky/migrate2rocky.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index 3f0e290..2e0ef7c 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -436,6 +436,7 @@ collect_system_info () { [rocky-release]=system-release ) addl_provide_removes=( + redhat-release redhat-release-eula )