pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk/tools



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.

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
 
 ######################################################################
 



Home | Main Index | Thread Index | Old Index