From: Michael Tremer Date: Sun, 23 Feb 2014 15:36:58 +0000 (+0100) Subject: grep: Update to 2.17. X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fipfire-3.x.git;a=commitdiff_plain;h=87621bcc7aceddb24b80ebffc529a176080cfed3 grep: Update to 2.17. Also adds automatic colouring of matched strings. --- diff --git a/grep/GREP_COLORS b/grep/GREP_COLORS new file mode 100644 index 000000000..1ef53a620 --- /dev/null +++ b/grep/GREP_COLORS @@ -0,0 +1,4 @@ +# Configuration file for the color grep utility + +# 'none' shuts colorization off. +#COLOR none diff --git a/grep/colorgrep.sh b/grep/colorgrep.sh new file mode 100644 index 000000000..929c78ae9 --- /dev/null +++ b/grep/colorgrep.sh @@ -0,0 +1,9 @@ +# color-grep initialization + +if [ -r /etc/GREP_COLORS ]; then + grep -qi "^COLOR.*none" /etc/GREP_COLORS >/dev/null 2>/dev/null && return +fi + +alias grep='grep --color=auto' 2>/dev/null +alias egrep='egrep --color=auto' 2>/dev/null +alias fgrep='fgrep --color=auto' 2>/dev/null diff --git a/grep/grep.nm b/grep/grep.nm index 0aa3427fc..2dea0cc27 100644 --- a/grep/grep.nm +++ b/grep/grep.nm @@ -4,7 +4,7 @@ ############################################################################### name = grep -version = 2.16 +version = 2.17 release = 1 groups = Applications/Text @@ -41,6 +41,14 @@ build test make check end + + install_cmds + mkdir -pv %{BUILDROOT}%{sysconfdir}/profile.d + install -m 644 %{DIR_SOURCE}/colorgrep.sh \ + %{BUILDROOT}%{sysconfdir}/profile.d + install -m 644 %{DIR_SOURCE}/GREP_COLORS \ + %{BUILDROOT}%{sysconfdir} + end end packages @@ -49,11 +57,17 @@ packages provides /bin/grep + bundled(gnulib) end conflicts filesystem < 002 end + + configfiles + %{sysconfdir}/profile.d/colorgrep.sh + %{sysconfdir}/GREP_COLORS + end end package %{name}-debuginfo