diff options
author | Erich Eckner <git@eckner.net> | 2018-06-11 14:24:16 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-11 14:24:16 +0200 |
commit | 48d9c19cedc9c5506815e7e56a53a43324419fab (patch) | |
tree | bf7adebed935b9c98c86a460d658e6aac24ee8ae /buildmaster/to-delete.php | |
parent | 8c116278a0bc8bd3be52419331d9bf866895322e (diff) | |
download | archweb32-48d9c19cedc9c5506815e7e56a53a43324419fab.tar.xz |
buildmaster/to-delete.php: use pacman cache instead of json web frontend to determine wether package is available upstream
Diffstat (limited to 'buildmaster/to-delete.php')
-rw-r--r-- | buildmaster/to-delete.php | 17 |
1 files changed, 8 insertions, 9 deletions
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); ?> <html> <head> @@ -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] = "<font color=\"" . $color . "\">" . |