[exim-cvs] exigrep: fallback to $PATH if zcat is missing. BU…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] exigrep: fallback to $PATH if zcat is missing. BUG 1575
Gitweb: http://git.exim.org/exim.git/commitdiff/fd4c285cd86a1c06acaa34c33cb898c057208ec5
Commit:     fd4c285cd86a1c06acaa34c33cb898c057208ec5
Parent:     9c19b270ead379003ece51fb49b83e7ea8b2d25e
Author:     Heiko Schlittermann (HS12) <hs@???>
AuthorDate: Sun Apr 26 23:20:29 2015 +0200
Committer:  Heiko Schlittermann (HS12) <hs@???>
CommitDate: Sun Apr 26 23:25:58 2015 +0200


    exigrep: fallback to $PATH if zcat is missing. BUG 1575
---
 doc/doc-docbook/spec.xfpt |    2 ++
 doc/doc-txt/ChangeLog     |    3 +++
 src/src/EDITME            |    8 +++++++-
 src/src/exigrep.src       |    2 +-
 4 files changed, 13 insertions(+), 2 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 9b7ada8..bc34d65 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -35713,6 +35713,8 @@ search term.
If the location of a &'zcat'& command is known from the definition of
ZCAT_COMMAND in &_Local/Makefile_&, &'exigrep'& automatically passes any file
whose name ends in COMPRESS_SUFFIX through &'zcat'& as it searches it.
+If the ZCAT_COMMAND is not executable, &'exigrep'& tries to use
+autodetection of some well known compression extensions.


 .section "Selecting messages by various criteria (exipick)" "SECTexipick"
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 08fb50f..a75c106 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -89,6 +89,9 @@ HS/01 DNSSEC options (dnssec_require_domains, dnssec_request_domains)
 JH/25 Bug 466: Add RFC2322 support for MIME attachment filenames.
       Original patch from Alexander Shikoff, worked over by JH.


+HS/02 Bug 1575: exigrep falls back to autodetection of compressed
+      files if ZCAT_COMMAND is not executable.
+


Exim version 4.85
-----------------
diff --git a/src/src/EDITME b/src/src/EDITME
index 41b929b..866987c 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -876,9 +876,15 @@ COMPRESS_SUFFIX=gz
# If the exigrep utility is fed compressed log files, it tries to uncompress
# them using this command.

+# Leave it empty to enforce autodetection at runtime:
+# ZCAT_COMMAND=
+#
+# Omit the path if you want to use your system's PATH:
+# ZCAT_COMMAND=zcat
+#
+# Or specify the full pathname:
ZCAT_COMMAND=/usr/bin/zcat

-
 #------------------------------------------------------------------------------
 # Compiling in support for embedded Perl: If you want to be able to
 # use Perl code in Exim's string manipulation language and you have Perl
diff --git a/src/src/exigrep.src b/src/src/exigrep.src
index 419fcb5..1b5bcf8 100644
--- a/src/src/exigrep.src
+++ b/src/src/exigrep.src
@@ -224,7 +224,7 @@ if (@ARGV)
   foreach (@ARGV)
     {
     my $filename = $_;
-    if ($filename =~ /\.(?:COMPRESS_SUFFIX)$/o)
+    if (-x 'ZCAT_COMMAND' && $filename =~ /\.(?:COMPRESS_SUFFIX)$/o)
       {
       open(LOG, "ZCAT_COMMAND $filename |") ||
         die "Unable to zcat $filename: $!\n";