From e3c2632c3e563018ecf986c6ee98c986bce36981 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Apr 04 2011 08:32:39 +0000 Subject: colorgrep scripts no longer overwrites COLORS envvar (#693058), thanks to Ville Skyttä --- diff --git a/colorgrep.csh b/colorgrep.csh index 1d9e94e..82bd09d 100644 --- a/colorgrep.csh +++ b/colorgrep.csh @@ -1,11 +1,8 @@ -#! /bin/csh -f # color-grep initialization -set COLORS=/etc/GREP_COLORS - -if ( -e "$COLORS" ) then - set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS` +if ( -r /etc/GREP_COLORS ) then + set color_none=`sed -n '/^COLOR.*none/Ip' < /etc/GREP_COLORS` if ( "$color_none" != '' ) then unset color_none exit diff --git a/colorgrep.sh b/colorgrep.sh index 5c61838..436518f 100644 --- a/colorgrep.sh +++ b/colorgrep.sh @@ -3,12 +3,8 @@ # Skip the rest for noninteractive shells. [ -z "$PS1" ] && return -COLORS= - -[ -e "/etc/GREP_COLORS" ] && COLORS="/etc/GREP_COLORS" - -if [ -n "$COLORS" ]; then - grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return +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 diff --git a/grep.spec b/grep.spec index e1e5b84..ee32b79 100644 --- a/grep.spec +++ b/grep.spec @@ -3,7 +3,7 @@ Summary: Pattern matching utilities Name: grep Version: 2.7 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ Group: Applications/Text Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}.tar.xz @@ -69,6 +69,10 @@ fi %{_mandir}/*/* %changelog +* Mon Apr 04 2011 Jaroslav Škarvada - 2.7-5 +- colorgrep scripts no longer overwrites COLORS envvar (#693058), + thanks to Ville Skyttä + * Wed Feb 09 2011 Fedora Release Engineering - 2.7-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild