distroquery.php: support for multiarch packages in repository packages list table

This commit is contained in:
Silvan Calarco 2024-07-06 22:20:17 +02:00
parent d625cb83c3
commit f019f312cd

View File

@ -64,7 +64,7 @@ $url_prefix = home_url() . "/rpms/";
$j = json_decode($request["body"], true);
if ($j["error"] != "") {
echo "<h3>ERROR: " . $j["error"] . "</h3>";
echo "<h5>ERROR: " . $j["error"] . "</h5>";
} else {
echo " > " . $repo;
@ -114,11 +114,18 @@ $url_prefix = home_url() . "/rpms/";
echo "0 " . _r("result(s) found");
}
echo "<table class=\"pkgpage\"><tr><th>" . _r("Name") . "</th><th>" . _r("Version") . "</th><th>" .
_r("Summary") . "</th><th>" . _r("Last update") . "</th></tr>";
echo "<table class=\"pkgpage\"><tr><th>" .
_r("Arch") . "</th><th>" .
_r("Name") . "</th><th>" .
_r("Version") . "</th><th>" .
_r("Summary") . "</th><th>" .
_r("Last update") . "</th></tr>";
foreach ($j["packages"] as $package) {
$package_url = $url_prefix . $repo . "/" . $package["name"];
echo "<tr><td><a href=\"" . $package_url . "\">". $package["name"] . "</a></td><td>" .
if ($package["arch"] != "src") $package_url .= "/" . $package["arch"];
echo "<tr><td>" .
$package["arch"] . "</td><td>" .
"<a href=\"" . $package_url . "\">". $package["name"] . "</a></td><td>" .
$package["version"] . "-" . $package["release"] . "</td><td>" .
$package["summary"] . "</td><td style=\"white-space:no-wrap\">" . substr($package["buildtime"], 0, 10) . "</td></tr>";
}