]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - html/qa.php
qa: add link to raw, add ac-th-diff
[projects/pld-ftp-admin.git] / html / qa.php
1 <html>
2 <head>
3 <link rel="Shortcut Icon" href="http://www.pld-linux.org/favicon.ico"/>
4         <title>PLD QA Reports</title>
5         <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="http://src.th.pld-linux.org/style.css">
6 </head>
7 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
8 <script>
9 jQuery(function($) {
10         $('#q').on('change', function(e) {
11                 var el = e.target;
12                 var o = el.options;
13                 var v = o[o.selectedIndex].value;
14                 location.href = "?q=" + v;
15         });
16 });
17 </script>
18 <body>
19 <?php
20
21 $report = isset($_GET['q']) ? basename($_GET['q']) : null;
22 $reports = array(
23         "main" => "Main deps x86_64",
24         "main-ready" => "Main ready deps x86_64",
25         "main-ready-test" => "Main+ready+test deps x86_64",
26
27         "main-i686" => "Main deps i686",
28         "main-ready-i686" => "Main ready deps i686",
29         "main-ready-test-i686" => "Main+ready+test deps i686",
30
31         "main-i486" => "Main deps i486",
32         "main-ready-i486" => "Main ready deps i486",
33         "main-ready-test-i486" => "Main+ready+test deps i486",
34
35         "ac-th-diff" => "Differences between AC and TH",
36         "freshness" => "GIT vs FTP freshness",
37
38         "lint-PLD" => "rpmlint: main",
39         "lint-test" => "rpmlint: test",
40         "lint-ready" => "rpmlint: ready",
41 );
42
43 echo "Select report:";
44 echo "<select id=q name=q>\n";
45 foreach ($reports as $q => $title) {
46         printf("<option value=%s %s>%s</option>\n", $q, $q == $report ? 'selected' :'',  $title);
47 }
48 echo "</select>\n";
49
50 if (isset($reports[$report])) {
51         echo "<a href=$report.txt>raw</a><br/>\n";
52         $file = "$report.txt";
53         $giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
54         foreach (file($file) as $line) {
55                 $line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) {
56                         $package = basename($m['spec'], '.spec');
57                         $url = sprintf($giturl, $package);
58                         return sprintf('<font color=red>%s</font> [<a href="%s">%s</a>] %s', $m['prefix'], $url, $m['spec'], $m['msg']);
59                 }, $line);
60                 echo $line, "<br/>\n";
61         }
62 }
63
64 ?>
65 </body>
66 </html>
This page took 0.051508 seconds and 3 git commands to generate.