summaryrefslogtreecommitdiffstats
path: root/autobuild/history.php
blob: c74b0b95a6d68ec8f40c68984b4401eb01d36b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$package=preg_replace('/[^[:alnum:]_.+-]/', '', $_GET['package']);
if (!$package) {
	die("Invalid package");
}
$db = new SQLite3('autobuild.db');
$package_id = $db->querySingle("SELECT Id FROM Packages WHERE Name = '$package'");
if (!$package_id)  {
        die("Invalid package");
}
echo "<h1>History of package \"$package\"</h1>\n";
$result = $db->query("SELECT date(datetime(Start, 'unixepoch')) as run, ResultValues.Name FROM Runs, Results, ResultValues WHERE Runs.Id = Results.Run AND Results.Result = ResultValues.Id AND Results.Package = '$package_id' ORDER BY Start DESC");
while ($entry = $result->fetchArray(SQLITE3_ASSOC)) {
    $run = $entry['run'];
    $build_result = $entry['Name'];
    echo "<a href='results.php?run=$run' >$run</a> ";
    if ($link = glob("cauldron/*/core/$run/$package-*.src.rpm/")) {
	    echo "<a href='$link[0]'>$build_result</a><br/>\n";
    } else {
	    echo "$build_result<br/>\n";
    }	    
}

?>