Account for no modules.

It is possible that we may get a system with no modules enabled.  Test and
account for this by skipping the enable modules step if necessary.
This commit is contained in:
Peter Ajamian 2021-05-12 13:44:41 +12:00
parent fdadcac23d
commit 49fa13494e

View File

@ -298,15 +298,17 @@ EOF
printf '%s\n' 'Repo name missing?' printf '%s\n' 'Repo name missing?'
exit 25 exit 25
} }
printf '%s\n' "${blue}Enabling modules$nocolor" ''
# We may very well need to do a reset/install here, but it takes a decent if (( ${#enabled_modules[@]} )); then
# amount of time, so we're better off just doing an enable unless we end up printf '%s\n' "${blue}Enabling modules$nocolor" ''
# with an explicit test case where reset/install is needed. # We may very well need to do a reset/install here, but it takes a
# decent amount of time, so we're better off just doing an enable unless
# we end up with an explicit test case where reset/install is needed.
# dnf -y module reset "${enabled_modules[@]}" # dnf -y module reset "${enabled_modules[@]}"
# dnf -y module install "${enabled_modules[@]}" # dnf -y module install "${enabled_modules[@]}"
dnf -y module enable "${enabled_modules[@]}" || dnf -y module enable "${enabled_modules[@]}" ||
exit_message "Can't enable modules ${enabled_modules[@]}" exit_message "Can't enable modules ${enabled_modules[@]}"
fi
printf '%s\n' '' "${blue}Syncing packages$nocolor" '' printf '%s\n' '' "${blue}Syncing packages$nocolor" ''
dnf -y distro-sync || exit_message "Error during distro-sync." dnf -y distro-sync || exit_message "Error during distro-sync."
} }