diff options
author | Erich Eckner <git@eckner.net> | 2018-03-23 10:47:48 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-03-23 10:47:48 +0100 |
commit | 4e2dbce045fa380a19d76d861c6d17654c10b786 (patch) | |
tree | 2b8d6e296927d35a79450118ba73f7c6499618ce | |
parent | a3888e3b4c363d7159e0274e75ecc7c7a9f3be1b (diff) | |
download | builder-4e2dbce045fa380a19d76d861c6d17654c10b786.tar.xz |
web-scripts/blacklist.php new
-rw-r--r-- | web-scripts/blacklist.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/web-scripts/blacklist.php b/web-scripts/blacklist.php new file mode 100644 index 0000000..6ad46f4 --- /dev/null +++ b/web-scripts/blacklist.php @@ -0,0 +1,47 @@ +<html> +<head> +<title>Blacklisted packages</title> +<link rel="stylesheet" type="text/css" href="/static/style.css"> +</head> +<body> +<table> +<tr><th>architecture</th><th>package</th><th>reason</th></tr> +<?php + +$mysql = new mysqli("localhost", "webserver", "empty", "buildmaster"); +if ($mysql->connect_error) { + die("Connection failed: " . $mysql->connect_error); +} +if ( ! $result = $mysql -> query( + "SELECT DISTINCT `architectures`.`name` AS `architecture`,`package_sources`.`pkgbase`,`build_assignments`.`is_black_listed` " . + "FROM `build_assignments` " . + "JOIN `architectures` ON `build_assignments`.`architecture`=`architectures`.`id` " . + "JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id` " . + "WHERE `build_assignments`.`is_black_listed` IS NOT NULL")) { + die($mysql->error); +} +if ($result -> num_rows > 0) { + while($row = $result->fetch_assoc()) { + print "<tr><td>"; + print $row["architecture"]; + print "</td><td>"; + print $row["pkgbase"]; + print "</td><td>"; + print preg_replace( + array ( + "/FS32#(\\d+)/", + "/FS#(\\d+)/" + ), + array ( + "<a href=\"https://bugs.archlinux32.org/index.php?do=details&task_id=$1\">$0</a>", + "<a href=\"https://bugs.archlinux.org/task/$1\">$0</a>" + ), + $row["is_black_listed"] + ); + print "</td></tr>\n"; + } +} +?> +</table> +</body> +</html> |