summaryrefslogtreecommitdiff
path: root/buildmaster/blacklist.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
committerErich Eckner <git@eckner.net>2018-04-17 10:04:07 +0200
commit5c5ed42237757efcf698a36c37cf9bd0630232c3 (patch)
tree184a92122c95c33ccb09aa5db2955af2d32e2771 /buildmaster/blacklist.php
parent8af016645fee5c0b22e69d46de9b3401c1bc82d3 (diff)
downloadarchweb32-5c5ed42237757efcf698a36c37cf9bd0630232c3.tar.xz
buildmaster/*.php: use lib/mysql.php
Diffstat (limited to 'buildmaster/blacklist.php')
-rw-r--r--buildmaster/blacklist.php61
1 files changed, 35 insertions, 26 deletions
diff --git a/buildmaster/blacklist.php b/buildmaster/blacklist.php
index c2810c6..274d769 100644
--- a/buildmaster/blacklist.php
+++ b/buildmaster/blacklist.php
@@ -1,33 +1,41 @@
+<?php
+
+ include "lib/mysql.php";
+
+ $result = mysql_run_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 " .
+ "ORDER BY `package_sources`.`pkgbase`"
+ );
+
+?>
<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>
+ <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 " .
- "ORDER BY `package_sources`.`pkgbase`")) {
- die($mysql->error);
-}
if ($result -> num_rows > 0) {
while($row = $result->fetch_assoc()) {
- print "<tr><td>";
+ print " <tr>\n";
+ print " <td>";
print $row["architecture"];
- print "</td><td>";
+ print "</td>\n";
+ print " <td>";
print $row["pkgbase"];
- print "</td><td>";
+ print "</td>\n";
+ print " <td>";
print preg_replace(
array (
"/FS32#(\\d+)/",
@@ -39,10 +47,11 @@ if ($result -> num_rows > 0) {
),
$row["is_black_listed"]
);
- print "</td></tr>\n";
+ print "</td>\n";
+ print " </tr>\n";
}
}
?>
-</table>
-</body>
+ </table>
+ </body>
</html>