Skip to content

Commit

Permalink
Merge pull request #509 from egypcio/egypcio
Browse files Browse the repository at this point in the history
jail -u: Verify TORELEASE before performing jail upgrade.
  • Loading branch information
bdrewery authored Jul 6, 2017
2 parents 31059ad + e7b204e commit f6f4014
Showing 1 changed file with 12 additions and 1 deletion.
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 @@ -828,7 +839,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

0 comments on commit f6f4014

Please sign in to comment.