diff options
Diffstat (limited to 'sysutils/pkg_install-devel/pkg-req')
-rw-r--r-- | sysutils/pkg_install-devel/pkg-req | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sysutils/pkg_install-devel/pkg-req b/sysutils/pkg_install-devel/pkg-req index c7d1b7507722..b57ba6f2ca2d 100644 --- a/sysutils/pkg_install-devel/pkg-req +++ b/sysutils/pkg_install-devel/pkg-req @@ -3,13 +3,18 @@ # $FreeBSD$ # -PKG_INFO=/usr/sbin/pkg_info +if [ -z "$OSVERSION" ]; then + if [ -x /sbin/sysctl ]; then + OSVERSION=`/sbin/sysctl -n kern.osreldate` + else + OSVERSION=`/usr/sbin/sysctl -n kern.osreldate` + fi +fi case $2 in INSTALL) - PKG_INSTALL_VER=`${PKG_INFO} -qP 2>/dev/null` - if [ -n "${PKG_INSTALL_VER}" -a "${PKG_INSTALL_VER}" -ge %%PORTVERSION%% ]; then - echo "Your base pkg_install tools are already up-to-date" + if [ "$OSVERSION" -ge 492000 -a "$OSVERSION" -lt 500000 -o "$OSVERSION" -ge 502120 ]; then + echo "$1: Your base pkg_install tools are already up-to-date." exit 1 fi ;; |