Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/buildmaster/deletion-links.php
diff options
context:
space:
mode:
Diffstat (limited to 'buildmaster/deletion-links.php')
-rw-r--r--buildmaster/deletion-links.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/buildmaster/deletion-links.php b/buildmaster/deletion-links.php
index f3a0aef..09b2424 100644
--- a/buildmaster/deletion-links.php
+++ b/buildmaster/deletion-links.php
@@ -10,10 +10,20 @@ if (isset($_GET["show_all"]))
else
$available_filter = "";
-$available = explode(
- "\n",
- shell_exec("find /var/lib/pacman/ -name '*.db' -exec tar -tzf {} \; | sed -n 's,-[^-]\+-[^-]\+/$,,;T;p' | sort -u")
-);
+$memcache = new Memcache;
+$memcache->connect('localhost', 11211) or die ('Memcached Connection Error');
+$available_upstream_packages = $memcache->get('available_upstream_packages');
+if ($available_upstream_packages === false) {
+ $available_upstream_packages = explode(
+ "\n",
+ shell_exec(
+ "find /var/lib/pacman/ -name '*.db' -exec tar -tzf {} \; " .
+ "| sed -n 's,-[^-]\+-[^-]\+/$,,;T;p' " .
+ "| sort -u"
+ )
+ );
+ $memcache->set('available_upstream_packages',$available_upstream_packages,0,1800);
+}
mysql_run_query(
"CREATE TEMPORARY TABLE `available` (" .
@@ -24,7 +34,7 @@ mysql_run_query(
mysql_run_query(
"INSERT INTO `available` (`pkgname`) VALUES (\"" .
- implode(array_map("base64_encode", $available), "\"),(\"") .
+ implode(array_map("base64_encode", $available_upstream_packages), "\"),(\"") .
"\")"
);