diff --git a/www/showlog.cgi b/www/showlog.cgi new file mode 100755 index 0000000000..06ef35154d --- /dev/null +++ b/www/showlog.cgi @@ -0,0 +1,124 @@ +#!/usr/bin/perl + +require "CGI.pm"; + +$req = new CGI; + +$date = $req->param('date'); +$type = $req->param('type'); + +print "Content-Type: text/html\n\n"; + +print < + + + + +Rockbox: $type $date + + + +MOO + ; + + +print "

$date, $type

\n"; + +my @o; +my $prob; +my $lserver; +my $buildtime; + +if($date =~ /(....)-(..)-(..)/) { + my $file = "allbuilds-$1$2$3"; + + open(LOG, ") { + if($_ =~ /^Build Server: (.*)/) { + $lserver = $1; + } + if($_ =~ /^Build Time: (.*)/) { + $buildtime = $1; + } + if( $_ =~ /^Build Date: (.*)/) { + if($date eq $1) { + $match++; + } + else { + $match=0; + } + } + elsif( $_ =~ /^Build Type: (.*)/) { + if($type eq $1) { + $match++; + } + else { + $match=0; + } + } + elsif(($match == 2) && + ($_ =~ /^Build Log Start/)) { + $match++; + push @o, "
"; + } + elsif($match == 3) { + if($_ =~ /^Build Log End/) { + $match=0; + } + else { + my $class=""; + $_ =~ s:/home/dast/rockbox-auto/::g; + $line = $_; + chomp $line; + + if($lserver) { + push @o, "Built on $lserver in $buildtime seconds
"; + $lserver=""; + } + + if($line =~ /^([^:]*):(\d*):.*warning:/) { + $prob++; + push @o, "\n"; + push @o, "
$line
\n"; + } + elsif($line =~ /^([^:]*):(\d+):/) { + $prob++; + push @o, "\n"; + push @o, "
$line
\n"; + } + elsif($line =~ /(: undefined reference to|ld returned (\d+) exit status|gcc: .*: No such file or)/) { + $prob++; + push @o, "\n"; + push @o, "
$line
\n"; + } + else { + push @o, "$line\n
\n"; + } + } + } + } + close(LOG); + + if($prob) { + print "Goto problem: "; + my $p; + foreach $p (1 .. $prob) { + print "$p\n"; + if($p == 5) { + last; + } + } + if($prob > 5 ) { + print "... last\n"; + } + + print "

\n"; + } + + print @o; + + print "

\n"; + +}