#!/opt/exptools/perl/bin/perl require "timelocal.pl"; use Date::Manip qw (ParseDate UnixDate); sub fill { local ($key,$val)=@_; if ($key eq 'Bug#'){ $val=m/\Q\E/; $val=$1; } $res{$key}=$val; #print "$key\;$val\n"; } $start0=0;$start1=0;$start2=0; $nline=0;@keysold=(); while (){ $nline++; chop (); if (/^\<\/HEAD\>/){ $start0=1;$start1=0;$start2=0;} if (/^HTTP\/1\.1 200 OK$/){ $start0=0;$start1=0;$start2=0; if ($res{"CRtime"} eq "") { $res{"CRtime"} = ""; }; @keys=sort keys %res; if ($#keys == 1){ print "$nline"; foreach $key (@keys){ print "\;$res{$key}"; } if ("@keysold" ne "@keys"){ print STDERR "@keysold\n@keys\n"; } @keysold=@keys; print "\n"; }else{ print STDERR "$nline\;$#keys\;@keys\n"; } undef %res; } if ($start0==1 && /^\Q \E$/){ $start0=0;$start1=1;$start2=0; #print STDERR "in 1\n"; } $low=$_;$low=~tr/[A-Z]/[a-z/; if ($start1==1 && $low =~ /\Q<\/table>\E/) { $start0=0;$start1=0;$start2=1; #print STDERR "in 2\n"; } if ($start2==1) { if (/Opened: ([^\<]+)\Bug#:<\/B><\/TD>
\E(\d+)\Q<\/A><\/TD>\E$/){ if ($1 ne $2) { print STDERR "Bug number mismatch: $1 and $2\n"; } &fill ('Bug#', $1); } if (/Created by (.+)$/){ $ll=$1; $ll=~m/([^\(]*)\(([^\)]+)\)/; $name=$1; $email=$2; $email=~s/\]+\>//; $email=~s/\<\/A\>//; $ll=~m/ on (.*)/; $d1=ParseDate($1); if ($d1 ne ""){ @xx=UnixDate($d1, "%S","%M","%H", "%d", "%m", "%y"); $xx[4] = substr($d1,4,2); $xx[4] --; $d2 = &timelocal(@xx); &fill("CRtime", $d2); $start2=0; }else{ &fill("CRtime", ""); print STDERR "$d1\;$1\n"; } } } }