rpms/grep/devel GREP_COLORS, NONE, 1.1 colorgrep.csh, 1.1, 1.2 colorgrep.sh, 1.1, 1.2 grep.spec, 1.85, 1.86

Jaroslav Škarvada jskarvad at fedoraproject.org
Fri Jun 11 09:34:47 UTC 2010


Author: jskarvad

Update of /cvs/pkgs/rpms/grep/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv10091

Modified Files:
	colorgrep.csh colorgrep.sh grep.spec 
Added Files:
	GREP_COLORS 
Log Message:
* Fri Jun 11 2010 Jaroslav Škarvada <jskarvad at redhat.com> - 2.6.3-4
- Colors can be globally disabled via /etc/GREP_COLORS (#602867)
- Fixed indentation in spec
- Fixed defattr in spec



--- NEW FILE GREP_COLORS ---
# Configuration file for the color grep utility

# 'none' shuts colorization off.
#COLOR none


Index: colorgrep.csh
===================================================================
RCS file: /cvs/pkgs/rpms/grep/devel/colorgrep.csh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- colorgrep.csh	7 Jun 2010 15:25:12 -0000	1.1
+++ colorgrep.csh	11 Jun 2010 09:34:46 -0000	1.2
@@ -1 +1,16 @@
+#! /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 ( "$color_none" != '' ) then
+        unset color_none
+        exit
+    endif
+    unset color_none
+endif
+
 alias grep 'grep --color=auto'


Index: colorgrep.sh
===================================================================
RCS file: /cvs/pkgs/rpms/grep/devel/colorgrep.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- colorgrep.sh	7 Jun 2010 15:25:12 -0000	1.1
+++ colorgrep.sh	11 Jun 2010 09:34:46 -0000	1.2
@@ -1 +1,14 @@
+# color-grep initialization
+
+# 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
+fi
+
 alias grep='grep --color=auto' 2>/dev/null


Index: grep.spec
===================================================================
RCS file: /cvs/pkgs/rpms/grep/devel/grep.spec,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -p -r1.85 -r1.86
--- grep.spec	7 Jun 2010 15:25:12 -0000	1.85
+++ grep.spec	11 Jun 2010 09:34:46 -0000	1.86
@@ -3,16 +3,17 @@
 Summary: Pattern matching utilities
 Name: grep
 Version: 2.6.3
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv3+
 Group: Applications/Text
 Source: ftp://ftp.gnu.org/pub/gnu/grep/grep-%{version}.tar.xz
 Source1: colorgrep.sh
 Source2: colorgrep.csh
+Source3: GREP_COLORS
 URL: http://www.gnu.org/software/grep/
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
-BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires: pcre-devel >= 3.9-10, texinfo, gettext
 BuildRequires: autoconf automake
 # Speedups DFA UTF-8 period patterns.
@@ -57,6 +58,7 @@ gzip $RPM_BUILD_ROOT%{_infodir}/grep*
 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
 install -pm 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
+install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
 
 %find_lang %name
 
@@ -75,15 +77,21 @@ if [ $1 = 0 ]; then
 fi
 
 %files -f %{name}.lang
-%defattr(-,root,root)
+%defattr(-,root,root,-)
 %doc ABOUT-NLS AUTHORS THANKS TODO NEWS README ChangeLog COPYING
 
 %{_bindir}/*
 %config(noreplace) %{_sysconfdir}/profile.d/colorgrep.*sh
+%config(noreplace) %{_sysconfdir}/GREP_COLORS
 %{_infodir}/*.info*.gz
 %{_mandir}/*/*
 
 %changelog
+* Fri Jun 11 2010 Jaroslav Škarvada <jskarvad at redhat.com> - 2.6.3-4
+- Colors can be globally disabled via /etc/GREP_COLORS (#602867)
+- Fixed indentation in spec
+- Fixed defattr in spec
+
 * Mon Jun 07 2010 Jaroslav Škarvada <jskarvad at redhat.com> - 2.6.3-3
 - Added auto-color profile.d scripts (thanks to Ville Skyttä #600832)
 - Removed description macro from changelog



More information about the scm-commits mailing list