From f3fe6d768a6f2f36bcb4a390e17a4f31eff2e499 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Fri, 11 Feb 2022 14:46:51 +1300 Subject: [PATCH] Fix issue where we didn't exit when we were supposed to. Exiting from a subshell doesn't actually exit the script. Move the exit to outside of the subshell. --- migrate2rocky/migrate2rocky.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index 8589d24..1618fba 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -357,11 +357,9 @@ bin_check() { # as a special-case below to avoid having the extras repository map to epel. repoquery () { local name val prev result - result=$( - safednf -y -q "${dist_repourl_swaps[@]}" \ - --setopt=epel.excludepkgs=epel-release repoquery -i "$1" || - exit_message "Failed to fetch info for package $1." - ) + result=$(safednf -y -q "${dist_repourl_swaps[@]}" \ + --setopt=epel.excludepkgs=epel-release repoquery -i "$1") || + exit_message "Failed to fetch info for package $1." if ! [[ $result ]]; then # We didn't match this package, the repo could be disabled. return 1