From ed6f5382fd1590e6d5cd343de2378351db3d9d89 Mon Sep 17 00:00:00 2001 From: rwx403335 Date: Mon, 20 Jun 2022 14:49:55 +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 8c31354..ed5570d 100644 --- a/gzip.spec +++ b/gzip.spec @@ -1,11 +1,13 @@ Name: gzip Version: 1.11 -Release: 4 +Release: 5 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 Patch6000: gzip-l-now-outputs-accurate-size.patch Patch6001: doc-document-gzip-l-change.patch @@ -50,6 +52,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 @@ -58,6 +66,7 @@ make check %doc AUTHORS ChangeLog README %license COPYING %{_bindir}/* +%{profiledir}/* %exclude %{_infodir}/dir %files help @@ -66,6 +75,9 @@ make check %{_mandir}/man1/* %changelog +* Mon Jun 20 2022 renhognxun - 1.11-5 +- config color alias for z*grep + * Tue May 24 2022 loong_C - 1.11-4 - fix spec changelog date -- Gitee