You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jh...@apache.org on 2012/12/23 03:48:09 UTC

svn commit: r1425396 - /spamassassin/trunk/masses/rule-qa/reports-from-logs

Author: jhardin
Date: Sun Dec 23 02:48:08 2012
New Revision: 1425396

URL: http://svn.apache.org/viewvc?rev=1425396&view=rev
Log:
Bug 6867 - fall back to time header if time is formatted to unexpected locale

Modified:
    spamassassin/trunk/masses/rule-qa/reports-from-logs

Modified: spamassassin/trunk/masses/rule-qa/reports-from-logs
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/reports-from-logs?rev=1425396&r1=1425395&r2=1425396&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/reports-from-logs (original)
+++ spamassassin/trunk/masses/rule-qa/reports-from-logs Sun Dec 23 02:48:08 2012
@@ -137,6 +137,15 @@ sub locate_input {
       elsif ($line =~ m/^# Date:\s*(\S+)/) {
         # a better way to do the above.  TODO: parse it instead
         $dateline{$file} = $1;
+        if (!defined $time{$file}) {
+          # if time line unparseable (localized?) use this instead
+          my ($yyyy, $mm, $dd, $h, $m, $s) = $dateline{$file} =~ /(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)Z/;
+          
+          my $timet = Time::ParseDate::parsedate("${yyyy}/${mm}/${dd} ${h}:${m}:${s} GMT+0",
+                    GMT => 1, PREFER_PAST => 1);
+
+          $time{$file} = $timet;
+        }
       }
       elsif ($line =~ m/^# SVN revision:\s*(\S+)/) {
         $revision{$file} = $1;