You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/03/13 06:02:09 UTC

svn commit: r157320 - spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla

Author: jm
Date: Sat Mar 12 21:02:07 2005
New Revision: 157320

URL: http://svn.apache.org/viewcvs?view=rev&rev=157320
Log:
fixing bug that was blocking needsmc code from using rules from the 'needsmc' comment itself

Modified:
    spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla

Modified: spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla?view=diff&r1=157319&r2=157320
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla (original)
+++ spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla Sat Mar 12 21:02:07 2005
@@ -19,6 +19,11 @@
 use strict;
 use bytes;
 
+my $grep_re;
+if (defined $ARGV[0]) {
+  $grep_re = $ARGV[0];
+}
+
 open (CF, "<config");
 my %conf; while(<CF>) { /^(\S+)=(\S+)/ and $conf{$1} = $2; }
 close CF;
@@ -66,6 +71,12 @@
 
   foreach my $bugurl (@buglinks) {
     my $url = $bugurl->url_abs;
+
+    if (defined $grep_re) {
+      print "testing '$url' against grep regexp\n";
+      next unless $url =~ /${grep_re}/o;
+    }
+
     $url =~ s/show_bug\.cgi/xml\.cgi/;  # use XML output
 
     my $bugnum = 0;
@@ -145,7 +156,7 @@
     }
   }
 
-# use Data::Dumper; warn "JMD ".Dumper($ctx);
+  # use Data::Dumper; warn "JMD ".Dumper($ctx);
   my $bug = $ctx->{bugnum};
 
   # and extract the code
@@ -313,7 +324,8 @@
 
     print "bug $ctx->{bugnum} cmt $cmt->{cmtnum}: needs-mc on $done already done\n";
   }
-  elsif ($text =~ /^Created an attachment \(id=(\d+)\)/)
+
+  if ($text =~ /^Created an attachment \(id=(\d+)\)/)
   {
     my $att = get_rules_from_attachment($ctx, $cmt, $1);
     read_cmt_rules_from_text($ctx, $cmt, $att);