#!/opt/exptools/perl/bin/perl # may be get from line too, in case stacie wants to use it @fieldnames=("Assigned To", 'Bug#', "CRname", "CRtime", "Component", "OS/Version", "Platform", "Priority", "Product", "QA Contact", "Reported By", "Resolution", "Severity", "Status", "Summary", "Target milestone", "URL", "Version"); require "timelocal.pl"; use Date::Manip qw (ParseDate UnixDate); sub fill { local ($key,$val)=@_; #$val=~s/\<[^\>]*\>//g; #$val=~s/\<[^\>]*\>//g; if ($key eq 'Bug#'){ $val=m/\Q\E/; $val=$1; }else{ if ($key eq 'URL'){ $val=~s/\Q<\/A>\E//; $val=~s/\Q\E//; $val=~s/\Q<\/A>\E//; } $val=~s/^ //; $val=~s/ $//; $val=~s/^ $//; if ($key eq 'Summary'){} else{ $val=~s/\ \;//g; $val=~s/\<\/TD\>//; } $val=~s/\;/SEMICOLON/g; } $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; @keys=sort keys %res; if ($#keys == 17){ 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\n"; } undef %res; } if ($start0==1 && /^\/){ $start0=0;$start1=1;$start2=0; } if ($start1==1 && /\<\/TABLE\>/) { $start0=0;$start1=0;$start2=1; &fill("CRname", ""); &fill("CRtime", ""); } if ($start2==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("CRname", $name); &fill("CRtime", $d2); $start2=0; }else{ &fill("CRname", $name); &fill("CRtime", ""); print STDERR "$name\;$email\;$d1\;$1\n"; } } } if ($start1==1) { if (/^\\\([^:]+)\:\<\/B\>(.+)$/){ &fill ($1, $2); } if (/^\\([^:]+)\:\<\/B\>(.+)$/){ &fill ($1, $2); } if (/^\\
\([^:]+)\:\<\/B\>(.+)$/){ &fill ($1, $2); } # if (/^\\\Bug\#\:\<\/B\>(.+)$/){ $Bug = $1; } # if (/^\\Product\:\<\/B\>(.+)$/){ $Product = $1; } # if (/^\\Version\:\<\/B\>(.+)$/){ $Version = $1; } # if (/^\\\OS\/Version\:\<\/B\> (.+)$/){ $OS = $1; } # if (/^\\Status\:\<\/B\>(.+)$/){ $Status = $1; } # if (/^\\Severity\:\<\/B\>(.+)$/){ $Severity = $1; } # if (/^\\Priority\:\<\/B\>(.+)$/){ $Priority = $1; } # if (/^\\\Resolution\:\<\/B\>(.+)$/){ $Resolution = $1; } # if (/^\\Assigned To\:\<\/B\>(.+)$/){ $Assigned = $1; } # if (/^\\Reported By\:\<\/B\>(.+)$/){ $Reported = $1; } # if (/^\\QA Contact\:\<\/B\>(.+)$/){ $Contact = $1; } # if (/^\\\Component\:\<\/B\>(.+)$/){ $Component = $1; } # if (/^\\Target milestone\:\<\/B\>(.+)$/){ $Target = $1; } # if (/^\\\URL\:\<\/B\>(.+)$/){ $URL = $1; } # if (/^\\\Summary\:\<\/B\>(.+)$/){ $Summary = $1; } # if (/^\\\Keywords\: \<\/B\> (.+)$/){ $Keywords = $1; } } }