svn commit: r368448 - in head: Mk ports-mgmt/pkg
Baptiste Daroussin
bapt at FreeBSD.org
Thu Sep 18 13:05:51 UTC 2014
Author: bapt
Date: Thu Sep 18 13:05:50 2014
New Revision: 368448
URL: http://svnweb.freebsd.org/changeset/ports/368448
QAT: https://qat.redports.org/buildarchive/r368448/
Log:
Add a minimal version testing for the installed pkg to enforce people to go to the latest version
Set minimal version to 1.3.7 for now
Differential Revision: D723
Reviewed by: bdrewery
Modified:
head/Mk/bsd.port.mk
head/ports-mgmt/pkg/Makefile
Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk Thu Sep 18 12:39:04 2014 (r368447)
+++ head/Mk/bsd.port.mk Thu Sep 18 13:05:50 2014 (r368448)
@@ -1099,6 +1099,7 @@ CO_ENV+= STAGEDIR=${STAGEDIR} \
PLIST_SUB_SED="${PLIST_SUB_SED}" \
PORT_OPTIONS="${PORT_OPTIONS}" \
PORTSDIR="${PORTSDIR}"
+MINIMAL_PKG_VERSION= 1.3.7
# make sure bmake treats -V as expected
.MAKE.EXPAND_VARIABLES= yes
@@ -1218,6 +1219,16 @@ WITH_NEW_XORG?= yes
# Only define tools here (for transition period with between pkg tools)
.include "${PORTSDIR}/Mk/bsd.commands.mk"
+.if exists(${PKG_BIN})
+.if !defined(_PKG_VERSION)
+_PKG_VERSION!= ${PKG_BIN} -v
+.endif
+_PKG_STATUS!= ${PKG_BIN} version -t ${_PKG_VERSION:S/-/\./g} ${MINIMAL_PKG_VERSION}
+.if ${_PKG_STATUS} == "<"
+IGNORE= You need pkg(8) at least version ${MINIMAL_PKG_VERSION} and you have ${_PKG_VERSION} please consider upgrading pkg(8) first
+.endif
+.endif
+
MASTERDIR?= ${.CURDIR}
.if ${MASTERDIR} != ${.CURDIR}
Modified: head/ports-mgmt/pkg/Makefile
==============================================================================
--- head/ports-mgmt/pkg/Makefile Thu Sep 18 12:39:04 2014 (r368447)
+++ head/ports-mgmt/pkg/Makefile Thu Sep 18 13:05:50 2014 (r368448)
@@ -2,6 +2,7 @@
PORTNAME= pkg
DISTVERSION= 1.3.7
+_PKG_VERSION= ${DISTVERSION}
CATEGORIES= ports-mgmt
MASTER_SITES= \
http://mirror.shatow.net/freebsd/${PORTNAME}/ \
More information about the svn-ports-head
mailing list