summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwww/showlog.cgi124
1 files changed, 124 insertions, 0 deletions
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 @@
1#!/usr/bin/perl
2
3require "CGI.pm";
4
5$req = new CGI;
6
7$date = $req->param('date');
8$type = $req->param('type');
9
10print "Content-Type: text/html\n\n";
11
12print <<MOO
13<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
14
15<html>
16<head>
17<link rel="STYLESHEET" type="text/css" href="/style.css">
18<title>Rockbox: $type $date</title>
19<meta name="author" content="Daniel Stenberg, in perl">
20</head>
21<body bgcolor="#b6c6e5" text="black" link="blue" vlink="purple" alink="red"
22 topmargin=3 leftmargin=4 marginwidth=4 marginheight=4>
23MOO
24 ;
25
26
27print "<h1>$date, $type</h1>\n";
28
29my @o;
30my $prob;
31my $lserver;
32my $buildtime;
33
34if($date =~ /(....)-(..)-(..)/) {
35 my $file = "allbuilds-$1$2$3";
36
37 open(LOG, "</home/dast/rockbox-distbuild/output/$file");
38 while(<LOG>) {
39 if($_ =~ /^Build Server: (.*)/) {
40 $lserver = $1;
41 }
42 if($_ =~ /^Build Time: (.*)/) {
43 $buildtime = $1;
44 }
45 if( $_ =~ /^Build Date: (.*)/) {
46 if($date eq $1) {
47 $match++;
48 }
49 else {
50 $match=0;
51 }
52 }
53 elsif( $_ =~ /^Build Type: (.*)/) {
54 if($type eq $1) {
55 $match++;
56 }
57 else {
58 $match=0;
59 }
60 }
61 elsif(($match == 2) &&
62 ($_ =~ /^Build Log Start/)) {
63 $match++;
64 push @o, "<div class=\"gccoutput\">";
65 }
66 elsif($match == 3) {
67 if($_ =~ /^Build Log End/) {
68 $match=0;
69 }
70 else {
71 my $class="";
72 $_ =~ s:/home/dast/rockbox-auto/::g;
73 $line = $_;
74 chomp $line;
75
76 if($lserver) {
77 push @o, "Built on <b>$lserver</b> in $buildtime seconds<br>";
78 $lserver="";
79 }
80
81 if($line =~ /^([^:]*):(\d*):.*warning:/) {
82 $prob++;
83 push @o, "<a name=\"prob$prob\"></a>\n";
84 push @o, "<div class=\"gccwarn\">$line</div>\n";
85 }
86 elsif($line =~ /^([^:]*):(\d+):/) {
87 $prob++;
88 push @o, "<a name=\"prob$prob\"></a>\n";
89 push @o, "<div class=\"gccerror\">$line</div>\n";
90 }
91 elsif($line =~ /(: undefined reference to|ld returned (\d+) exit status|gcc: .*: No such file or)/) {
92 $prob++;
93 push @o, "<a name=\"prob$prob\"></a>\n";
94 push @o, "<div class=\"gccerror\">$line</div>\n";
95 }
96 else {
97 push @o, "$line\n<br>\n";
98 }
99 }
100 }
101 }
102 close(LOG);
103
104 if($prob) {
105 print "Goto problem: ";
106 my $p;
107 foreach $p (1 .. $prob) {
108 print "<a href=\"#prob$p\">$p</a>\n";
109 if($p == 5) {
110 last;
111 }
112 }
113 if($prob > 5 ) {
114 print "... <a href=\"#prob$prob\">last</a>\n";
115 }
116
117 print "<p>\n";
118 }
119
120 print @o;
121
122 print "</div></body></html>\n";
123
124}