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,24 +1099,19 @@ fetch_setup_verboselevel } -# Packaged base and freebsd-update are incompatible. Exit with an error if -# packaged base is in use. +# Return 0 if the system is managed using pkgbase, 1 otherwise. check_pkgbase() { # Packaged base requires that pkg is bootstrapped. - if ! pkg -c ${BASEDIR} -N >/dev/null 2>/dev/null; then - return + if ! pkg -r ${BASEDIR} -N >/dev/null 2>/dev/null; then + return 1 fi # uname(1) is used by pkg to determine ABI, so it should exist. # If it comes from a package then this system uses packaged base. - if ! pkg -c ${BASEDIR} which /usr/bin/uname >/dev/null; then - return + if ! pkg -r ${BASEDIR} which /usr/bin/uname >/dev/null; then + return 1 fi - cat <