Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 928783 Details for
Bug 1034631
[RFE] If grep is colored, *z*grep should be as well
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed fix
grep-color-script.patch (text/plain), 2.52 KB, created by
Jaroslav Škarvada
on 2014-08-20 12:18:55 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jaroslav Škarvada
Created:
2014-08-20 12:18:55 UTC
Size:
2.52 KB
patch
obsolete
>diff --git a/colorgrep.csh b/colorgrep.csh >index 0b76c97..b3152a6 100644 >--- a/colorgrep.csh >+++ b/colorgrep.csh >@@ -1,13 +1,9 @@ > > # color-grep initialization > >-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 >- endif >- unset color_none >+/usr/libexec/grepconf.sh -c >+if ( $status == 1 ) then >+ exit > endif > > alias grep 'grep --color=auto' >diff --git a/colorgrep.sh b/colorgrep.sh >index 57f7aba..cd0539c 100644 >--- a/colorgrep.sh >+++ b/colorgrep.sh >@@ -1,8 +1,6 @@ > # color-grep initialization > >-if [ -r /etc/GREP_COLORS ]; then >- grep -qi "^COLOR.*none" /etc/GREP_COLORS >/dev/null 2>/dev/null && return >-fi >+/usr/libexec/grepconf.sh -c || return > > alias grep='grep --color=auto' 2>/dev/null > alias egrep='egrep --color=auto' 2>/dev/null >diff --git a/grep.spec b/grep.spec >index a4798b0..7458394 100644 >--- a/grep.spec >+++ b/grep.spec >@@ -3,13 +3,14 @@ > Summary: Pattern matching utilities > Name: grep > Version: 2.20 >-Release: 4%{?dist} >+Release: 5%{?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 >+Source4: grepconf.sh > # upstream ticket 39444 > Patch0: grep-2.20-man-fix-gs.patch > # upstream ticket 39445 >@@ -57,6 +58,7 @@ 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} >+install -Dpm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/grepconf.sh > > %find_lang %name > >@@ -85,8 +87,13 @@ fi > %config(noreplace) %{_sysconfdir}/GREP_COLORS > %{_infodir}/*.info*.gz > %{_mandir}/*/* >+%{_libexecdir}/grepconf.sh > > %changelog >+* Wed Aug 20 2014 Jaroslav Å karvada <jskarvad@redhat.com> - 2.20-5 >+- Added script to check whether grep is coloured >+ Resolves: rhbz#1034631 >+ > * Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.20-4 > - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild > >diff --git a/grepconf.sh b/grepconf.sh >new file mode 100644 >index 0000000..418af0b >--- /dev/null >+++ b/grepconf.sh >@@ -0,0 +1,11 @@ >+#!/bin/sh >+ >+case "$1" in >+ -c | --interactive-color) >+ ! grep -qsi "^COLOR.*none" /etc/GREP_COLORS >+ ;; >+ *) >+ echo >&2 "Invalid / no option passed, so far only -c | --interactive-color is supported." >+ exit 1 >+ ;; >+esac
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1034631
:
829314
|
829316
|
849803
|
849812
| 928783