Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify TORELEASE before performing jail upgrade. #509

Merged
merged 5 commits into from
Jul 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/share/poudriere/jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ update_jail() {
msg "Upgrading using ${METHOD}"
case ${METHOD} in
ftp|http|ftp-archive)
# In case we use FreeBSD dists and TORELEASE is present, check if it's a release branch.
if [ -n "${TORELEASE}" ]; then
case ${TORELEASE} in
*-ALPHA*|*-CURRENT|*-PRERELEASE|*-STABLE)
msg_error "Only release branches are supported by the ${METHOD} method."
msg_error "Please try to upgrade to a new BETA, RC or RELEASE version."
exit 1
;;
*) ;;
esac
fi
MASTERMNT=${JAILMNT}
MASTERNAME=${JAILNAME}-${PTNAME}${SETNAME:+-${SETNAME}}
[ -n "${RESOLV_CONF}" ] && cp -v "${RESOLV_CONF}" "${JAILMNT}/etc/"
Expand Down Expand Up @@ -823,7 +834,7 @@ create_jail() {

markfs clean ${JAILMNT}

# Check VERSION before running 'update_jail' on FreeBSD dists.
# Check VERSION before running 'update_jail' on jails created using FreeBSD dists.
case ${METHOD} in
ftp|http|ftp-archive)
[ ${VERSION#*-RELEAS*} != ${VERSION} ] && update_jail
Expand Down