3 <link rel="Shortcut Icon" href="//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="//srcbuilder.pld-linux.org/th/style.css">
7 .hidden { display: none; }
8 span#count { font-weight: bold; }
11 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
14 $('#q').on('change', function(e) {
17 var v = o[o.selectedIndex].value;
18 location.href = "?q=" + v;
21 var $lines = $('#lines>li');
22 var $count = $('#count');
23 $('#filter').on('keyup', function() {
24 var search = $(this).val();
26 $lines.each(function() {
28 var text = $line.text();
29 var fn = text.match(search) && ++count ? 'removeClass' : 'addClass';
34 $count.html($lines.length);
40 $report = isset($_GET['q']) ? basename($_GET['q']) : null;
42 "main" => "Main deps x86_64",
43 "main-ready" => "Main ready deps x86_64",
44 "main-ready-test" => "Main+ready+test deps x86_64",
46 "main-i686" => "Main deps i686",
47 "main-ready-i686" => "Main ready deps i686",
48 "main-ready-test-i686" => "Main+ready+test deps i686",
50 "main-x32" => "Main deps x32",
51 "main-ready-x32" => "Main ready deps x32",
52 "main-ready-test-x32" => "Main+ready+test deps x32",
54 "freshness" => "GIT vs FTP freshness",
56 "lint-PLD" => "rpmlint: main",
57 "lint-test" => "rpmlint: test",
58 "lint-ready" => "rpmlint: ready",
61 function reports_selection($reports) {
63 echo "Select report:";
64 echo "<select id=q name=q>\n";
65 foreach ($reports as $q => $title) {
66 printf("<option value=%s %s>%s</option>\n", $q, $q == $report ? 'selected' :'', $title);
72 * Create text input for filtering results
74 function filter_box() {
75 echo '<br>Filter results: <input id="filter">';
76 echo '<br><span id="count">?</span> errors';
79 function format_report($report) {
80 echo "<br>View the <a href=$report.txt>raw</a> report<br/>\n";
81 $file = "$report.txt";
82 $giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
83 echo '<ol id="lines">';
84 foreach (file($file) as $line) {
85 $line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) {
86 $package = basename($m['spec'], '.spec');
87 $url = sprintf($giturl, $package);
88 return sprintf('<li><font color=red>%s</font> [<a href="%s">%s</a>] %s', $m['prefix'], $url, $m['spec'], $m['msg']);
90 echo $line, "<br/>\n";
95 reports_selection($reports);
97 if (isset($reports[$report])) {
98 format_report($report);