Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2014 13:05:50 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r368448 - in head: Mk ports-mgmt/pkg
Message-ID:  <201409181305.s8ID5oMr025124@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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}/ \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409181305.s8ID5oMr025124>