summaryrefslogtreecommitdiff
path: root/status.php
diff options
context:
space:
mode:
Diffstat (limited to 'status.php')
-rw-r--r--status.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/status.php b/status.php
new file mode 100644
index 0000000..2b4e8a9
--- /dev/null
+++ b/status.php
@@ -0,0 +1,62 @@
+<?php
+
+function parse($name) {
+ $inhalt = explode("-",$name);
+ $arch = array_pop($inhalt);
+ $pkgrel = array_pop($inhalt);
+ $pkgver = array_pop($inhalt);
+ $pkgname = implode("-",$inhalt);
+ return array(
+ "filename" => $name,
+ "pkgname" => $pkgname,
+ "pkgver" => $pkgver,
+ "pkgrel" => $pkgrel,
+ "arch" => $arch
+ );
+};
+
+$f = fopen("packages", "r");
+while (!feof($f))
+ $soll[] = trim(fgets($f));
+fclose($f);
+
+$f = popen("find ~archlinuxewe/os -type f -name '*.pkg.tar.zst.sig' -printf '%f\n'", "r");
+while (!feof($f))
+ $ist[] = substr(trim(fgets($f)),0,-16);
+pclose($f);
+
+$ist = array_map('parse', $ist);
+$soll = array_map('parse', $soll);
+
+$pkgs = array();
+
+foreach($ist as $i) {
+ $pkgs[$i["pkgname"]][$i["arch"]]["ist"] = $i;
+}
+foreach($soll as $i) {
+ $pkgs[$i["pkgname"]][$i["arch"]]["soll"] = $i;
+}
+
+?>
+<!DOCTYPE html>
+<html><body><table>
+<?php
+
+foreach ($pkgs as $pkgname => $pkg) {
+ print "<tr><td colspan=3>" . $pkgname . "</td></tr>\n";
+ foreach ($pkg as $arch => $apkg) {
+ print "<tr><td>" . $arch . "</td><td>";
+ if ($apkg["ist"]["filename"] == $apkg["soll"]["filename"])
+ $farbe = "#008000";
+ else
+ $farbe = "#c00000";
+ print "<font color=\"" . $farbe . "\">";
+ print $apkg["ist"]["filename"];
+ print "</font></td><td><font color=\"" . $farbe . "\">";
+ print $apkg["soll"]["filename"];
+ print "</font></td></tr>\n";
+ }
+}
+
+?>
+</table></body></html>