aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-07-02 08:31:18 +0800
committereik <eik@FreeBSD.org>2004-07-02 08:31:18 +0800
commitcf5e7fd4665161e8be08470f893dd40fa4c0d878 (patch)
tree3aeca6610f56d5860c90b0224e077443c77f9ee4 /sysutils
parent0fd73fe5899065be19d9456924aa7f49ec61d124 (diff)
downloadfreebsd-ports-gnome-cf5e7fd4665161e8be08470f893dd40fa4c0d878.tar.gz
freebsd-ports-gnome-cf5e7fd4665161e8be08470f893dd40fa4c0d878.tar.zst
freebsd-ports-gnome-cf5e7fd4665161e8be08470f893dd40fa4c0d878.zip
Test OSVERSION instead of pkg_info -P to enable cross-version builds
Requested by: kris
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/pkg_install-devel/pkg-req13
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
;;