index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | buildmaster/build-log.php | 32 |
diff --git a/buildmaster/build-log.php b/buildmaster/build-log.php new file mode 100644 index 0000000..3cd0051 --- /dev/null +++ b/buildmaster/build-log.php @@ -0,0 +1,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']); |