From 48d9c19cedc9c5506815e7e56a53a43324419fab Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 11 Jun 2018 14:24:16 +0200 Subject: buildmaster/to-delete.php: use pacman cache instead of json web frontend to determine wether package is available upstream --- buildmaster/to-delete.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'buildmaster') diff --git a/buildmaster/to-delete.php b/buildmaster/to-delete.php index 99a386c..da9ded9 100644 --- a/buildmaster/to-delete.php +++ b/buildmaster/to-delete.php @@ -19,6 +19,11 @@ "AND `repositories`.`is_on_master_mirror`" ); + $available = explode( + "\n", + shell_exec("find /var/lib/pacman/ -name '*.db' -exec tar -tzf {} \; | sed -n 's,-[^-]\+-[^-]\+/$,,;T;p'") + ); + $available = array_combine( $available, $available); ?> @@ -36,16 +41,10 @@ if ($result -> num_rows > 0) { while ($row = $result->fetch_assoc()) { - if (strstr( - file_get_contents( - "https://www.archlinux.org/packages/search/json/?q=" . - $row["pkgname"] - ), - "\"pkgname\": \"".$row["pkgname"]."\"" - ) === FALSE) - $color = "#00FF00"; - else + if (isset($available[$row["pkgname"]])) $color = "#FF0000"; + else + $color = "#00FF00"; $rows[$count] = "" . -- cgit v1.2.3-70-g09d2