Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/buildmaster/build-log.php
blob: 3cd0051421b45b6923f14441f6d0ef4e3a0d817a (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
25
26
27
28
29
30
31
32
<?php
require_once "../init.php";

require_once BASE . "/lib/helper.php";
require_once BASE . "/lib/mysql.php";

$extra_joins = '';
$filter = 'WHERE 1';

if (array_key_exists('a', $_GET)) {
  $extra_joins .= mysql_join_build_assignments_architectures();
  $filter .= ' AND `architectures`.`name`=from_base64("' . base64_encode($_GET['a']) . '")';
}

if (array_key_exists('p', $_GET)) {
  $extra_joins .= mysql_join_build_assignments_package_sources();
  $filter .= ' AND `package_sources`.`pkgbase`=from_base64("' . base64_encode($_GET['p']) . '")';
}

$result = mysql_run_query(
  'SELECT `failed_builds`.`log_file` FROM `failed_builds`' .
  mysql_join_failed_builds_build_assignments() .
  $extra_joins .
  $filter .
  ' ORDER BY `failed_builds`.`date` DESC' .
  ' LIMIT 1'
);

$result = $result -> fetch_assoc();

header('HTTP/1.1 303 See Other');
header('Location: https://buildmaster.archlinux32.org/build-logs/error/' . $result['log_file']);