1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

Test OSVERSION instead of pkg_info -P to enable cross-version builds

Requested by:	kris
This commit is contained in:
Oliver Eikemeier 2004-07-02 00:31:18 +00:00
parent f2d50f5392
commit 580eeeff30
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=112714
4 changed files with 22 additions and 18 deletions

View File

@ -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
;;

View File

@ -36,15 +36,12 @@ SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e "s|%%REQPKGVER%%|${REQPKGVER}|g" \
-e "s|%%BZIP2_CMD%%|${BZIP2_CMD}|g" \
PKG_INFO_BASE?= /usr/sbin/pkg_info
BASEPKGVER!= ${PKG_INFO_BASE} -qP 2>/dev/null || ${TRUE}
.include <bsd.port.pre.mk>
.if ${BASEPKGVER} < ${REQPKGVER}
.if ${OSVERSION} < 492000 || ${OSVERSION} >= 500000 && ${OSVERSION} < 502120
RUN_DEPENDS= ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/sysutils/pkg_install-devel
.endif
.include <bsd.port.pre.mk>
.if defined(BZIP2DEPENDS)
RUN_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2
.endif

View File

@ -36,15 +36,12 @@ SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e "s|%%REQPKGVER%%|${REQPKGVER}|g" \
-e "s|%%BZIP2_CMD%%|${BZIP2_CMD}|g" \
PKG_INFO_BASE?= /usr/sbin/pkg_info
BASEPKGVER!= ${PKG_INFO_BASE} -qP 2>/dev/null || ${TRUE}
.include <bsd.port.pre.mk>
.if ${BASEPKGVER} < ${REQPKGVER}
.if ${OSVERSION} < 492000 || ${OSVERSION} >= 500000 && ${OSVERSION} < 502120
RUN_DEPENDS= ${LOCALBASE}/sbin/pkg_info:${PORTSDIR}/sysutils/pkg_install-devel
.endif
.include <bsd.port.pre.mk>
.if defined(BZIP2DEPENDS)
RUN_DEPENDS+= bzip2:${PORTSDIR}/archivers/bzip2
.endif

View File

@ -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
;;