Mailing List Archive

svn commit: r202279 - /spamassassin/trunk/masses/remove-ids-from-mclog
Author: jm
Date: Tue Jun 28 13:25:53 2005
New Revision: 202279

URL: http://svn.apache.org/viewcvs?rev=202279&view=rev
Log:
minor tweak; support reading ID strings from a mass-check format

Modified:
spamassassin/trunk/masses/remove-ids-from-mclog

Modified: spamassassin/trunk/masses/remove-ids-from-mclog
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/remove-ids-from-mclog?rev=202279&r1=202278&r2=202279&view=diff
==============================================================================
--- spamassassin/trunk/masses/remove-ids-from-mclog (original)
+++ spamassassin/trunk/masses/remove-ids-from-mclog Tue Jun 28 13:25:53 2005
@@ -4,6 +4,10 @@
#
# usage: remove-ids-from-mclog idlist < log > log.new
#
+# idlist can either be a file listing ID strings, one per line, or
+# a file containing grepped lines from a mass-check log, in which
+# case the IDs will be read from each line.
+#
# <@LICENSE>
# Copyright 2004 Apache Software Foundation
#
@@ -33,7 +37,14 @@

my %ids = ();
open (IN, "<$file") or usage();
-while (<IN>) { chop; $ids{$_}++; }
+while (<IN>) {
+ chop;
+ if (/^[Y\.]\s+-?\d+\s+(\S+)\s+\S+/) {
+ $ids{$1}++; # mass-check lines
+ } else {
+ $ids{$_}++; # just the IDs
+ }
+}
close IN;

my $rmed = 0;