index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-07-06 21:16:28 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-07-06 21:16:28 +0200 |
commit | dd6498966b6f4fba0c23464554529aaebb0398f5 (patch) | |
tree | 062694b3351a6a0d50f134705e0c53a075c16bf3 /buildmaster | |
parent | 5447bb29af07d712dc32d182b8c25d63ca477bce (diff) |
-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']); |