distroquery: SRPMS package view: improve built rpms and build requirements by providing a table with archs as columns

This commit is contained in:
Silvan Calarco 2024-07-07 13:51:15 +02:00
parent f019f312cd
commit b1d479283d

View File

@ -175,20 +175,43 @@ $url_prefix = home_url() . "/rpms/";
<tr><td width="15%"><?php echo _r("Size") ?>:</td><td><?php echo $j["size"] ?></td></tr>
<tr><td width="15%"><?php echo _r("Upstream URL") ?>:</td><td><a href="<?php echo $j["url"] ?>" target=_blank><?php echo $j["url"] ?></a></td></tr>
<tr><td width="15%"><?php echo _r("Build time") ?>:</td><td><?php echo iso8601_to_datetime($j["buildtime"]) ?></td></tr>
<tr><td width="15%"><?php echo _r("Built RPMS") ?>:</td><td><?php
foreach ($j["children"] as $child) {
$child_url = $url_prefix . $repo . "/" . $child["name"] . "/" . $child["arch"];
echo "<a href=\"" . $child_url . "\">" . $child["name"] . "(" . $child["arch"] . ")</a> ";
} ?>
</td></tr>
<tr><td width="15%"><?php echo _r("Build requirements") ?>:</td><td><?php
</table>
<table class="pkgpage" width="100%"><?php
echo "<tr><th></th>";
foreach ($j["children"]["archs"] as $arch => $value) {
echo "<th>" . $arch . "</th>";
}
echo "</tr><tr><td>" . _r("Built RPMS") . "</td>";
foreach ($j["children"]["archs"] as $arch => $value) {
echo "<td>";
foreach ($j["children"]["archs"][$arch] as $child) {
$child_url = $url_prefix . $repo . "/" . $child["name"] . "/" . $arch;
echo "<a href=\"" . $child_url . "\">" . $child["name"] . "</a><br/>";
}
echo "</td>";
}
echo "</tr><tr><td>" . _r("Build requirements") . "</td>";
foreach ($j["children"]["archs"] as $arch => $value) {
echo "<td>";
foreach ($j["buildrequires"] as $buildrequire) {
echo $buildrequire["name"];
if ($buildrequire["flags"] != "") echo "[" . $buildrequire["flags"] . $buildrequire["version"] . "]";
echo " ";
} ?>
</td></tr>
$cnt = 0;
foreach ($buildrequire["providers"]["archs"][$arch] as $provider) {
$cnt++;
$provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch;
echo " <a href=\"" . $provider_url . "\">[" . $cnt . "]</a>";
}
if ($cnt == 0) echo " (" . _r("unresolved") . ")";
echo "<br/>";
}
echo "</td>";
}
echo "</tr>";
?>
</table>
<?php