From 6c55aec7fd3f4e21f473f3d4a848673e96e6364e Mon Sep 17 00:00:00 2001 From: rwx403335 Date: Tue, 20 Sep 2022 11:46:00 +0800 Subject: [PATCH] config color alias for z*grep --- colorzgrep.csh | 9 +++++++++ colorzgrep.sh | 6 ++++++ gzip.spec | 14 +++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 colorzgrep.csh create mode 100644 colorzgrep.sh diff --git a/colorzgrep.csh b/colorzgrep.csh new file mode 100644 index 0000000..71d03bb --- /dev/null +++ b/colorzgrep.csh @@ -0,0 +1,9 @@ +t -f /usr/libexec/grepconf.sh +if ( $status == 1 ) exit + +/usr/libexec/grepconf.sh -c +if ( $status == 1 ) exit + +alias zgrep 'zgrep --color=auto' +alias zfgrep 'zfgrep --color=auto' +alias zegrep 'zegrep --color=auto' diff --git a/colorzgrep.sh b/colorzgrep.sh new file mode 100644 index 0000000..7764a07 --- /dev/null +++ b/colorzgrep.sh @@ -0,0 +1,6 @@ +[ -f /usr/libexec/grepconf.sh ] || return + +/usr/libexec/grepconf.sh -c || return +alias zgrep='zgrep --color=auto' 2>/dev/null +alias zfgrep='zfgrep --color=auto' 2>/dev/null +alias zegrep='zegrep --color=auto' 2>/dev/null diff --git a/gzip.spec b/gzip.spec index ec576d4..56a5708 100644 --- a/gzip.spec +++ b/gzip.spec @@ -1,11 +1,13 @@ Name: gzip Version: 1.12 -Release: 1 +Release: 2 Summary: A data compression utility License: GPLv3 URL: https://www.gnu.org/software/gzip Source0: https://ftp.gnu.org/gnu/gzip/gzip-%{version}.tar.xz +Source1: colorzgrep.csh +Source2: colorzgrep.sh Patch9000: fix-verbose-disable.patch Patch9001: performance-neoncrc32-and-prfm.patch @@ -42,6 +44,12 @@ rm -rf %RPM_BUILD_ROOT # ncompress provides uncompress, may cause conflict. rm -f %{buildroot}%{_bindir}/uncompress +# config color alias for z*grep +%global profiledir %{_sysconfdir}/profile.d +mkdir -p %{buildroot}%{profiledir} +install -p -m 644 %{SOURCE1} %{buildroot}%{profiledir} +install -p -m 644 %{SOURCE2} %{buildroot}%{profiledir} + %check make check @@ -50,6 +58,7 @@ make check %doc AUTHORS ChangeLog README %license COPYING %{_bindir}/* +%{profiledir}/* %exclude %{_infodir}/dir %files help @@ -58,6 +67,9 @@ make check %{_mandir}/man1/* %changelog +* Tue Sep 20 2022 renhongxun - 1.12-2 +- config color alias for z*grep + * Sat Jun 11 2022 YukariChiba - 1.12-1 - Upgrade version. -- Gitee