diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1099,6 +1099,25 @@ fetch_setup_verboselevel } +# Packaged base and freebsd-update are incompatible. Exit with an error if +# packaged base is in use. +check_pkgbase() +{ + # Packaged base requires that pkg is bootstrapped. + if ! pkg -c ${BASEDIR} -N >/dev/null 2>/dev/null; then + return + fi + # Presence of FreeBSD-* package(s) indicates packaged base. + if ! pkg -c ${BASEDIR} info -q -x '^FreeBSD' 2>/dev/null; then + return + fi + cat <