mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-22 05:01:25 +00:00
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:
parent
fdadcac23d
commit
49fa13494e
@ -298,15 +298,17 @@ EOF
|
||||
printf '%s\n' 'Repo name missing?'
|
||||
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
|
||||
# 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.
|
||||
if (( ${#enabled_modules[@]} )); then
|
||||
printf '%s\n' "${blue}Enabling modules$nocolor" ''
|
||||
# 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 install "${enabled_modules[@]}"
|
||||
dnf -y module enable "${enabled_modules[@]}" ||
|
||||
exit_message "Can't enable modules ${enabled_modules[@]}"
|
||||
fi
|
||||
printf '%s\n' '' "${blue}Syncing packages$nocolor" ''
|
||||
dnf -y distro-sync || exit_message "Error during distro-sync."
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user