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) {
62 echo "Select report:";
63 echo "<select id=q name=q>\n";
64 foreach ($reports as $q => $title) {
65 printf("<option value=%s %s>%s</option>\n", $q, $q == $report ? 'selected' :'', $title);
71 * Create text input for filtering results
73 function filter_box() {
74 echo '<br>Filter results: <input id="filter">';
75 echo '<br><span id="count">?</span> errors';
78 function format_report($report) {
79 echo "<br>View the <a href=$report.txt>raw</a> report<br/>\n";
80 $file = "$report.txt";
81 $giturl = 'http://git.pld-linux.org/gitweb.cgi?p=packages/%1$s.git;f=%1$s.spec;h=HEAD;a=shortlog';
82 echo '<ol id="lines">';
83 foreach (file($file) as $line) {
84 $line = preg_replace_callback('/^(?P<prefix>error:|GIT:)\s*\[(?P<spec>[^]]+)\]\s*(?P<msg>.+)$/', function($m) use ($giturl) {
85 $package = basename($m['spec'], '.spec');
86 $url = sprintf($giturl, $package);
87 return sprintf('<li><font color=red>%s</font> [<a href="%s">%s</a>] %s', $m['prefix'], $url, $m['spec'], $m['msg']);
89 echo $line, "<br/>\n";
94 reports_selection($reports);
96 if (isset($reports[$report])) {
97 format_report($report);