-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.490 2007/03/13 10:05:16 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.491 2007/03/13 11:06:48 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/35 Applied a patch from the Sieve maintainer which fixes a bug in "notify".
+PH/36 Applied John Jetmore's patch to add -v functionality to exigrep.
+
Exim version 4.66
-----------------
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.143 2007/02/26 14:07:04 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.144 2007/03/13 11:06:48 ph10 Exp $
New Features in Exim
--------------------
is set as the separator. Two such characters in succession are interpreted
as enclosing an empty list item.
+19. The exigrep utility now has a -v option, which inverts the matching
+ condition.
+
Version 4.66
------------
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.75 2007/03/13 09:50:22 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.76 2007/03/13 11:06:48 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
Much helpful testing of the test suite & elsewhere
Patch for -Mset
Patch for TLS testing with -bh/-bhc/-bs
+ Patch for exigrep -v functionality
Bob Johannessen Patch for Sieve envelope tests bug
Patch for negative uid/gid bug
Brad Jorsch Patch for bitwise logical operators
#! PERL_COMMAND -w
-# $Cambridge: exim/src/src/exigrep.src,v 1.6 2007/02/14 16:44:22 ph10 Exp $
+# $Cambridge: exim/src/src/exigrep.src,v 1.7 2007/03/13 11:06:48 ph10 Exp $
use strict;
# This subroutine processes a single line (in $_) from a log file. Program
# defensively against short lines finding their way into the log.
-my (%saved, %id_list, $pattern, $queue_time, $insensitive);
+my (%saved, %id_list, $pattern, $queue_time, $insensitive, $invert);
sub do_line {
# Are we interested in this id ? Short circuit if we already were interested.
- $id_list{$id} = 1 if defined $id_list{$id} ||
- ($insensitive && /$pattern/io) || /$pattern/o;
+ if ($invert)
+ {
+ $id_list{$id} = 1 if (!defined($id_list{$id}));
+ $id_list{$id} = 0 if (($insensitive && /$pattern/io) || /$pattern/o);
+ }
+ else
+ {
+ $id_list{$id} = 1 if defined $id_list{$id} ||
+ ($insensitive && /$pattern/io) || /$pattern/o;
+ }
# See if this is a completion for some message. If it is interesting,
# print it, but in any event, throw away what was saved.
print "$saved{$id}\n";
}
+ delete $id_list{$id};
delete $saved{$id};
}
}
# Handle the case where the log line does not belong to a specific message.
# Print it if it is interesting.
-elsif (($insensitive && $_ =~ /$pattern/io) || $_ =~ /$pattern/o)
+elsif ( ($invert && (($insensitive && !/$pattern/io) || !/$pattern/o)) ||
+ (!$invert && (($insensitive && /$pattern/io) || /$pattern/o)) )
{ print "$_\n"; }
}
# are quoted if the -l flag is given. The -t flag gives a time-on-queue value
# which is an additional condition.
-getopts('Ilt:',\my %args);
-$queue_time = $args{'t'}? $args{'t'} : -1;
+getopts('Ilvt:',\my %args);
+$queue_time = $args{'t'}? $args{'t'} : -1;
$insensitive = $args{'I'}? 0 : 1;
+$invert = $args{'v'}? 1 : 0;
-die "usage: exigrep [-I] [-l] [-t <seconds>] <pattern> [<log file>]...\n"
+die "usage: exigrep [-I] [-l] [-t <seconds>] [-v] <pattern> [<log file>]...\n"
if ($#ARGV < 0);
$pattern = shift @ARGV;