Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-25 14:16:17 +0200
committerErich Eckner <git@eckner.net>2018-06-25 14:16:17 +0200
commit31d142f5ac9dbbca62534b636ebdc6229cfeb00b (patch)
tree360b29353eab020ab1f4bb91cdefe300699d7aa2
parente75fcbfde823568d0202761c3e099afddf901028 (diff)
buildmaster/deletion-links.php: hide unavailable packages (but show them on request)
-rw-r--r--buildmaster/deletion-links.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/buildmaster/deletion-links.php b/buildmaster/deletion-links.php
index 11541fb..6b00c65 100644
--- a/buildmaster/deletion-links.php
+++ b/buildmaster/deletion-links.php
@@ -5,6 +5,37 @@ require_once BASE . "/lib/mysql.php";
$edges = "";
$knots = "";
+if (isset($_GET["show_all"]))
+ $available_filter = " LEFT";
+else
+ $available_filter = "";
+
+$available = explode(
+ "\n",
+ shell_exec("find /var/lib/pacman/ -name '*.db' -exec tar -tzf {} \; | sed -n 's,-[^-]\+-[^-]\+/$,,;T;p' | sort -u")
+);
+
+mysql_run_query(
+ "CREATE TEMPORARY TABLE `available` (" .
+ "`pkgname` VARCHAR(88), " .
+ "UNIQUE KEY `name` (`pkgname`)" .
+ ")"
+);
+
+mysql_run_query(
+ "INSERT INTO `available` (`pkgname`) VALUES (\"" .
+ implode(array_map("base64_encode", $available), "\"),(\"") .
+ "\")"
+);
+
+mysql_run_query(
+ "DELETE FROM `available` WHERE `available`.`pkgname`=\"\""
+);
+
+mysql_run_query(
+ "UPDATE `available` SET `available`.`pkgname`=from_base64(`available`.`pkgname`)"
+);
+
mysql_run_query(
"CREATE TEMPORARY TABLE `d_bpir` (" .
"`id` BIGINT, " .
@@ -18,10 +49,20 @@ mysql_run_query(
"INSERT IGNORE INTO `d_bpir` (`id`,`color`)" .
" SELECT" .
" `binary_packages_in_repositories`.`id`," .
- "IF(`build_assignments`.`is_black_listed` IS NULL,\"#800000\",\"#ff0000\") AS `color`" .
+ "IF(" .
+ "`available`.`pkgname` IS NULL," .
+ "\"#00ff00\"," .
+ "IF(" .
+ "`build_assignments`.`is_black_listed` IS NULL," .
+ "\"#800000\"," .
+ "\"#ff0000\"" .
+ ")" .
+ ") AS `color`" .
" FROM `binary_packages_in_repositories`" .
" JOIN `binary_packages` ON `binary_packages_in_repositories`.`package`=`binary_packages`.`id`" .
" JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" .
+ $available_filter .
+ " JOIN `available` ON `available`.`pkgname`=`binary_packages`.`pkgname`" .
" WHERE `binary_packages_in_repositories`.`is_to_be_deleted`" .
" AND `binary_packages`.`pkgname` NOT LIKE \"lib32-%\""
);