Received: by mail.netbsd.org (Postfix, from userid 605) id 2147F84F37; Wed, 17 Oct 2018 08:22:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 271DB84F22 for ; Wed, 17 Oct 2018 08:22:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 0U22iIjKNA2j for ; Wed, 17 Oct 2018 08:22:19 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 7447184DEB for ; Wed, 17 Oct 2018 08:22:19 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 6D5FDFBEE; Wed, 17 Oct 2018 08:22:19 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1539764539178190" MIME-Version: 1.0 Date: Wed, 17 Oct 2018 08:22:19 +0000 From: "Jonathan Perkin" Subject: CVS commit: pkgsrc/mk/tools To: pkgsrc-changes@NetBSD.org Reply-To: jperkin@netbsd.org X-Mailer: log_accum Message-Id: <20181017082219.6D5FDFBEE@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1539764539178190 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: jperkin Date: Wed Oct 17 08:22:19 UTC 2018 Modified Files: pkgsrc/mk/tools: replace.mk Log Message: mk: Add support for a ggrep tool. This is for when GNU features are required that aren't available in some other greps, for example -o or --color. If ggrep is requested then it takes precedence over grep/egrep/fgrep and the GNU versions are used for all three. BSD grep aims for GNU compatibility so it is anticipated that it can be used as a native tool to avoid a dependency on textproc/grep on platforms that provide it. To generate a diff of this commit: cvs rdiff -u -r1.284 -r1.285 pkgsrc/mk/tools/replace.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1539764539178190 Content-Disposition: inline Content-Length: 1945 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/tools/replace.mk diff -u pkgsrc/mk/tools/replace.mk:1.284 pkgsrc/mk/tools/replace.mk:1.285 --- pkgsrc/mk/tools/replace.mk:1.284 Wed Aug 22 20:48:37 2018 +++ pkgsrc/mk/tools/replace.mk Wed Oct 17 08:22:19 2018 @@ -1,4 +1,4 @@ -# $NetBSD: replace.mk,v 1.284 2018/08/22 20:48:37 maya Exp $ +# $NetBSD: replace.mk,v 1.285 2018/10/17 08:22:19 jperkin Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -970,21 +970,35 @@ TOOLS_PATH.[= ${LOCALBASE}/bin/g[ ###################################################################### # These tools are all supplied by the textproc/grep package if there is -# no native tool available. +# no native tool available. If explicit GNU versions are requested via +# "ggrep" then they are preferred. # _TOOLS.grep= egrep fgrep grep -.for _t_ in ${_TOOLS.grep} -. if !defined(TOOLS_IGNORE.${_t_}) && !empty(_USE_TOOLS:M${_t_}) -. if !empty(PKGPATH:Mtextproc/grep) +.if !defined(TOOLS_IGNORE.ggrep) && !empty(_USE_TOOLS:Mggrep) +. if !empty(PKGPATH:Mtextproc/grep) +MAKEFLAGS+= TOOLS_IGNORE.ggrep= +. elif !empty(_TOOLS_USE_PKGSRC.ggrep:M[yY][eE][sS]) +TOOLS_DEPENDS.ggrep?= grep>=2.5.1:../../textproc/grep +. for _t_ in ${_TOOLS.grep} +TOOLS_CREATE+= g${_t_} +TOOLS_PATH.g${_t_}= ${LOCALBASE}/bin/g${_t_} +TOOLS_ALIASES.g${_t_}= ${_t_} +. endfor +. endif +.else +. for _t_ in ${_TOOLS.grep} +. if !defined(TOOLS_IGNORE.${_t_}) && !empty(_USE_TOOLS:M${_t_}) +. if !empty(PKGPATH:Mtextproc/grep) MAKEFLAGS+= TOOLS_IGNORE.${_t_}= -. elif !empty(_TOOLS_USE_PKGSRC.${_t_}:M[yY][eE][sS]) +. elif !empty(_TOOLS_USE_PKGSRC.${_t_}:M[yY][eE][sS]) TOOLS_DEPENDS.${_t_}?= grep>=2.5.1:../../textproc/grep TOOLS_CREATE+= ${_t_} TOOLS_PATH.${_t_}= ${LOCALBASE}/bin/g${_t_} +. endif . endif -. endif -.endfor +. endfor +.endif ###################################################################### --_----------=_1539764539178190--