Merge pull request #923 from BastilleBSD/tschettervictor-patch-1

upgrade: Check release before jail
This commit is contained in:
tschettervictor
2025-04-04 17:37:26 -06:00
committed by GitHub

View File

@@ -125,15 +125,16 @@ thin_jail_check() {
} }
release_check() { release_check() {
local _release="${1}"
# Validate the release # Validate the release
if ! echo "${NEWRELEASE}" | grep -q "[0-9]\{2\}.[0-9]-[RELEASE,BETA,RC]"; then if ! echo "${_release}" | grep -q "[0-9]\{2\}.[0-9]-[RELEASE,BETA,RC]"; then
error_exit "${NEWRELEASE} is not a valid release." error_exit "${_release} is not a valid release."
fi fi
# Exit if NEWRELEASE doesn't exist # Exit if NEWRELEASE doesn't exist
if [ "${THIN_JAIL}" -eq 1 ]; then if [ "${THIN_JAIL}" -eq 1 ]; then
if [ ! -d "${bastille_releasesdir}/${NEWRELEASE}" ]; then if [ ! -d "${bastille_releasesdir}/${_release}" ]; then
error_notify "Release not found: ${NEWRELEASE}" error_notify "Release not found: ${_release}"
error_exit "See 'bastille bootstrap ${NEWRELEASE} to bootstrap the release." error_exit "See 'bastille bootstrap ${_release} to bootstrap the release."
fi fi
fi fi
} }
@@ -212,11 +213,11 @@ if [ "${NEWRELEASE}" = "install" ]; then
fi fi
jail_updates_install "${TARGET}" jail_updates_install "${TARGET}"
else else
release_check "${NEWRELEASE}"
if [ "${THIN_JAIL}" -eq 1 ]; then if [ "${THIN_JAIL}" -eq 1 ]; then
thin_jail_check "${TARGET}" thin_jail_check "${TARGET}"
else else
thick_jail_check "${TARGET}" thick_jail_check "${TARGET}"
fi fi
release_check
jail_upgrade "${TARGET}" "${NEWRELEASE}" jail_upgrade "${TARGET}" "${NEWRELEASE}"
fi fi