2024-06-01 22:31:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Distroquery API Template
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @file distroquery.php
|
|
|
|
* @package openmamba-theme
|
|
|
|
* @author Silvan Calarco
|
|
|
|
* @copyright 2024
|
|
|
|
* @license license.txt
|
|
|
|
* @version Release: 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Exit if accessed directly
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2024-07-11 01:00:53 +02:00
|
|
|
$api_url = "https://push.openmamba.org/openmamba/distroquery/api/v1/";
|
|
|
|
#$api_url = "https://openmamba.org/distroquery/api/v1/";
|
|
|
|
|
2024-07-07 16:05:16 +02:00
|
|
|
function human_filesize($bytes, $dec = 2): string {
|
|
|
|
$size = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
|
|
|
$factor = floor((strlen($bytes) - 1) / 3);
|
|
|
|
if ($factor == 0) $dec = 0;
|
|
|
|
return sprintf("%.{$dec}f %s", $bytes / (1024 ** $factor), $size[$factor]);
|
|
|
|
}
|
|
|
|
|
2024-06-29 12:52:20 +02:00
|
|
|
$url_prefix = home_url() . "/rpms/";
|
2024-06-01 22:31:12 +02:00
|
|
|
|
|
|
|
?>
|
|
|
|
<?php get_header(); ?>
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
<div id="content-full" class="grid col-940"><span id="distromatic">
|
2024-06-01 22:31:12 +02:00
|
|
|
|
|
|
|
<?php
|
2024-06-02 12:19:32 +02:00
|
|
|
// Navigation bar
|
|
|
|
echo "<a href=\"" . home_url() . "\">Home</a>";
|
2024-06-01 22:31:12 +02:00
|
|
|
|
|
|
|
$repo=get_query_var('repo');
|
|
|
|
$package=get_query_var('package');
|
|
|
|
$arch=get_query_var('arch');
|
|
|
|
|
2024-12-07 00:43:56 +01:00
|
|
|
$get_args = array(
|
|
|
|
'timeout' => 15,
|
|
|
|
'sslverify' => false
|
|
|
|
);
|
|
|
|
|
2024-06-29 14:04:42 +02:00
|
|
|
|
2024-06-01 22:31:12 +02:00
|
|
|
if ($repo == "") {
|
|
|
|
//
|
|
|
|
// Repositories
|
|
|
|
//
|
2024-06-29 14:04:42 +02:00
|
|
|
echo " > " . _r("Repositories");
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-06-29 14:04:42 +02:00
|
|
|
echo "<h1>" . _r("Available repositories") . ":</h1>";
|
2024-12-07 00:43:56 +01:00
|
|
|
$request = wp_remote_get($api_url . "repositories", $get_args);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (is_wp_error($request)) {
|
2024-08-11 17:57:04 +02:00
|
|
|
echo "<p>ERROR: " . $request->get_error_message() . "</p>";
|
2024-07-11 01:00:53 +02:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
$j = json_decode($request["body"], true);
|
2024-06-01 22:31:12 +02:00
|
|
|
foreach ($j as $repository) {
|
|
|
|
$repository_url = $url_prefix . $repository["tag"];
|
|
|
|
echo "<a href=\"" . $repository_url . "\">". $repository["tag"] . "</a>: " . $repository["description"] . "</br>";
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ($package == "") {
|
|
|
|
//
|
|
|
|
// Repository
|
|
|
|
//
|
2024-06-02 12:19:32 +02:00
|
|
|
echo " > <a href=\"" . $url_prefix . "\">Repositories</a>";
|
|
|
|
|
2024-07-11 01:00:53 +02:00
|
|
|
$page = isset($_GET['page'])?$_GET['page']:"";
|
|
|
|
$q = isset($_GET['q'])?$_GET['q']:"";
|
2024-07-06 18:28:59 +02:00
|
|
|
$query_append = "";
|
2024-07-11 01:00:53 +02:00
|
|
|
if ($page != "") $query_append .="&page=" . $page;
|
2024-07-06 18:28:59 +02:00
|
|
|
if ($q != "") $query_append .= "&q=" . urlencode($q);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (strlen($query_append) > 0 && $query_append[0] == '&') $query_append[0] = "?";
|
|
|
|
|
2024-12-07 00:43:56 +01:00
|
|
|
$request = wp_remote_get($api_url . "repository/" . $repo . $query_append, $get_args);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (is_wp_error($request)) {
|
2024-08-11 17:57:04 +02:00
|
|
|
echo "<p>ERROR: " . $request->get_error_message() . "</p>";
|
2024-07-11 01:00:53 +02:00
|
|
|
goto finish;
|
|
|
|
}
|
2024-07-06 18:28:59 +02:00
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
$j = json_decode($request["body"], true);
|
|
|
|
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["error"])) {
|
2024-07-06 22:20:17 +02:00
|
|
|
echo "<h5>ERROR: " . $j["error"] . "</h5>";
|
2024-06-02 12:19:32 +02:00
|
|
|
} else {
|
|
|
|
|
|
|
|
echo " > " . $repo;
|
2024-06-29 14:04:42 +02:00
|
|
|
echo "<h1>" . _r("List of packages") . ":</h1>";
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-07-06 18:28:59 +02:00
|
|
|
echo "<form id=\"distroquery\" method=\"get\" action=\"" . $url_prefix . "/" . $repo . "\">";
|
|
|
|
echo "<label class=\"screen-reader-text\" for=\"q\">" . _r("Search packages") . ":</label>";
|
|
|
|
echo "<input id=\"q\" class=\"field\" type=\"text\" name=\"q\" placeholder=\"" . _r("Search here") . "\"> - ";
|
|
|
|
if ($q != "") echo _r("Results for:") . " <strong>" . $q . "</strong> - ";
|
|
|
|
|
2024-07-06 17:22:41 +02:00
|
|
|
// Pagination
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination = "";
|
2024-07-06 17:22:41 +02:00
|
|
|
if ($j["query"]["pages"]) {
|
2024-07-06 18:28:59 +02:00
|
|
|
$query_append = "";
|
|
|
|
if ($q != "") $query_append .= "&q=" . urlencode($q);
|
2024-07-06 17:22:41 +02:00
|
|
|
$page = $j["query"]["page"];
|
|
|
|
$pages = $j["query"]["pages"];
|
|
|
|
$from_page = 1;
|
|
|
|
if ($page > 10) $from_page = $page - 10;
|
|
|
|
$to_page = $from_page + 20;
|
|
|
|
if ($to_page > $pages) {
|
|
|
|
$to_page = $pages;
|
|
|
|
$from_page = $to_page - 20;
|
|
|
|
if ($from_page < 1) $from_page = 1;
|
|
|
|
}
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination .= "" . $j["query"]["total"] . " " . _r("result(s) found") . " - " .
|
2024-07-06 18:28:59 +02:00
|
|
|
_r("Showing page") . " " . $page . " " . _r("of") . " " . $pages . " [ ";
|
2024-07-06 17:22:41 +02:00
|
|
|
if ($from_page > 1) {
|
|
|
|
$back_page = $from_page - 10;
|
|
|
|
if ($back_page < 1) $back_page = 1;
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination .= "<a href=\"" . $url_prefix . "/" . $repo . "?page=" . $back_page . $query_append . "\"><</a> ";
|
2024-07-06 17:22:41 +02:00
|
|
|
}
|
2024-11-03 19:00:49 +01:00
|
|
|
$prev_page = "";
|
|
|
|
$next_page = "";
|
2024-07-06 17:22:41 +02:00
|
|
|
for ($i = $from_page; $i <= $to_page; $i++) {
|
|
|
|
if ($i != $j["query"]["page"]) {
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination .= "<a href=\"" . $url_prefix . "/" . $repo . "?page=" . $i . $query_append . "\">" . $i . "</a> ";
|
|
|
|
if ($i == $j["query"]["page"]+1) $next_page = $i;
|
2024-07-06 17:22:41 +02:00
|
|
|
} else {
|
2024-11-03 19:00:49 +01:00
|
|
|
if ($i >= 2 && $prev_page == "") $prev_page = $i - 1;
|
|
|
|
$pagination .= "<strong>" . $i . "</strong> ";
|
2024-07-06 17:22:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($to_page < $pages) {
|
2024-11-03 19:00:49 +01:00
|
|
|
$curr_next_page = $to_page + 10;
|
|
|
|
if ($curr_next_page > $pages) $curr_next_page = $pages;
|
|
|
|
if ($curr_next_page < 1) $curr_next_page = 1;
|
|
|
|
$pagination .= "<a href=\"" . $url_prefix . "/" . $repo . "?page=" . $curr_next_page . $query_append . "\">></a> ";
|
2024-07-06 17:22:41 +02:00
|
|
|
}
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination .= "]<div style=\"float:right\">";
|
|
|
|
if ($prev_page != "") {
|
|
|
|
$pagination .= "<a href=\"" . $url_prefix . "/" . $repo . "?page=" . $prev_page . $query_append . "\">< " . _r("Prev") . "</a> ";
|
|
|
|
}
|
|
|
|
if ($next_page != "") {
|
|
|
|
$pagination .= " <a href=\"" . $url_prefix . "/" . $repo . "?page=" . $next_page . $query_append . "\">" . _r("Next") . " ></a> ";
|
|
|
|
}
|
|
|
|
$pagination .= "</div>";
|
2024-07-06 18:28:59 +02:00
|
|
|
} else {
|
2024-11-03 19:00:49 +01:00
|
|
|
$pagination .= "0 " . _r("result(s) found");
|
2024-07-06 17:22:41 +02:00
|
|
|
}
|
2024-11-03 19:00:49 +01:00
|
|
|
echo $pagination;
|
2024-07-06 17:22:41 +02:00
|
|
|
|
2024-07-06 22:20:17 +02:00
|
|
|
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>";
|
2024-07-06 17:22:41 +02:00
|
|
|
foreach ($j["packages"] as $package) {
|
2024-06-02 12:19:32 +02:00
|
|
|
$package_url = $url_prefix . $repo . "/" . $package["name"];
|
2024-07-06 22:20:17 +02:00
|
|
|
if ($package["arch"] != "src") $package_url .= "/" . $package["arch"];
|
|
|
|
echo "<tr><td>" .
|
|
|
|
$package["arch"] . "</td><td>" .
|
|
|
|
"<a href=\"" . $package_url . "\">". $package["name"] . "</a></td><td>" .
|
2024-07-06 19:21:58 +02:00
|
|
|
$package["version"] . "-" . $package["release"] . "</td><td>" .
|
|
|
|
$package["summary"] . "</td><td style=\"white-space:no-wrap\">" . substr($package["buildtime"], 0, 10) . "</td></tr>";
|
2024-06-02 12:19:32 +02:00
|
|
|
}
|
2024-07-06 19:21:58 +02:00
|
|
|
echo "</table>";
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-11-03 19:00:49 +01:00
|
|
|
echo $pagination;
|
|
|
|
|
2024-07-06 18:28:59 +02:00
|
|
|
echo "</form>";
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
}
|
2024-06-01 22:31:12 +02:00
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
} else if ($arch == "") {
|
|
|
|
//
|
|
|
|
// Source package
|
|
|
|
//
|
2024-06-29 14:04:42 +02:00
|
|
|
echo " > <a href=\"" . $url_prefix . "\">" . _r("Repositories") . "</a>";
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-12-07 00:43:56 +01:00
|
|
|
$request = wp_remote_get($api_url . "package/" . $repo . "/" . $package, $get_args);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (is_wp_error($request)) {
|
2024-08-11 17:57:04 +02:00
|
|
|
echo "<p>ERROR: " . $request->get_error_message() . "</p>";
|
2024-07-11 01:00:53 +02:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
$j = json_decode($request["body"], true);
|
|
|
|
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["error"])) {
|
2024-06-29 14:04:42 +02:00
|
|
|
echo "<h3>" . _r("ERROR") . ": " . $j["error"] . "</h3>";
|
2024-06-02 12:19:32 +02:00
|
|
|
} else {
|
|
|
|
echo " > <a href=\"" . $url_prefix . "/" . $repo . "\">$repo</a> > " . $package;
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2024-06-29 14:04:42 +02:00
|
|
|
<div class="box" style="float:right;min-width:150px;padding:10px;">
|
|
|
|
<b><?php echo _r("Resources") ?>:</b><br/>
|
|
|
|
<a href="<?php echo $j["source_url"] ?>" target=_blank><?php echo _r("Source files") ?></a> |
|
|
|
|
<a href="<?php echo $j["source_url"] ?>/commits/branch/main" target=_blank><?php echo _r("Changes") ?></a><br/>
|
|
|
|
<a href="<?php echo $j["source_url"] ?>/issues" target=_blank><?php echo _r("Issues") ?></a> |
|
|
|
|
<a href="<?php echo $j["source_url"] ?>/issues/new" target=_blank><?php echo _r("Add a new issue") ?></a><br/>
|
|
|
|
<a href="<?php echo $j["download_url"] ?>" target=_blank><?php echo _r("Download") ?></a>
|
|
|
|
</div>
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
<h1><img src="https://www.google.com/s2/favicons?domain=<?php echo $j["url"] ?>" width="24" height="24">
|
|
|
|
<?php echo $j["name"] ?>: <?php echo $j["summary"] ?></h1>
|
|
|
|
|
2024-07-07 14:56:17 +02:00
|
|
|
<?php echo nl2br($j["description"]) ?>
|
2024-07-07 14:23:16 +02:00
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
<table class="pkgpage" width="100%">
|
2024-06-29 14:04:42 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Name") ?>:</td><td><?php echo $j["name"] ?></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("Release") ?>:</td><td>
|
2024-06-02 12:19:32 +02:00
|
|
|
<?php if ($j["epoch"] != "0") echo $j["epoch"].":";
|
|
|
|
echo $j["version"]."-".$j["release"] ?></td></tr>
|
2024-06-29 14:04:42 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Group") ?>:</td><td><?php echo $j["group"] ?></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("Maintainer") ?>:</td><td><?php echo $j["maintainer"] ?></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("License") ?>:</td><td><?php echo $j["license"] ?></td></tr>
|
2024-07-07 16:05:16 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Size") ?>:</td><td><?php echo human_filesize($j["size"]) ?></td></tr>
|
2024-06-29 14:04:42 +02:00
|
|
|
<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>
|
2024-07-07 13:51:15 +02:00
|
|
|
</table>
|
|
|
|
|
2024-07-07 14:23:16 +02:00
|
|
|
<?php
|
|
|
|
// Built RPMS and requirements table
|
|
|
|
echo "<h5>" . _r("Binary packages and requirements") . "</h5>";
|
|
|
|
echo "<table class=\"pkgpage\" width=\"100%\"><tr><th></th>";
|
2024-07-07 13:51:15 +02:00
|
|
|
|
|
|
|
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"] . "]";
|
|
|
|
$cnt = 0;
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($buildrequire["providers"]["archs"][$arch])) {
|
|
|
|
foreach ($buildrequire["providers"]["archs"][$arch] as $provider) {
|
|
|
|
$cnt++;
|
|
|
|
$provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch;
|
|
|
|
echo " <a href=\"" . $provider_url . "\">[" . $cnt . "]</a>";
|
|
|
|
}
|
2024-07-07 13:51:15 +02:00
|
|
|
}
|
|
|
|
if ($cnt == 0) echo " (" . _r("unresolved") . ")";
|
|
|
|
echo "<br/>";
|
|
|
|
}
|
|
|
|
echo "</td>";
|
|
|
|
}
|
2024-07-07 14:23:16 +02:00
|
|
|
echo "</tr></table>";
|
|
|
|
|
|
|
|
// Changelog
|
|
|
|
echo "<h5>" . _r("History of changes") . "</h5>";
|
|
|
|
echo "<table class=\"pkgpage\" width=\"100%\"><tr><th>" . _r("Date") .
|
|
|
|
"</th><th>" . _r("Packager") . "</th><th>" . _r("Release") .
|
|
|
|
"</th><th>" . _r("Description") . "</th></tr>";
|
|
|
|
|
|
|
|
foreach ($j["changelog"] as $changelog) {
|
|
|
|
echo "<tr><td>" . substr($changelog["date"],0,10) . "</td><td>" . $changelog["packager"] . "</td><td>" .
|
|
|
|
$changelog["release"] . "</td><td>" . nl2br($changelog["text"]) . "</td></tr>";
|
|
|
|
}
|
|
|
|
echo "</table>";
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-07-07 13:51:15 +02:00
|
|
|
?>
|
2024-06-02 12:19:32 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
} else if ($arch != "") {
|
2024-06-01 22:31:12 +02:00
|
|
|
//
|
|
|
|
// Package
|
|
|
|
//
|
2024-06-29 14:04:42 +02:00
|
|
|
echo " > <a href=\"" . $url_prefix . "\">" . _r("Repositories") . "</a>";
|
2024-06-02 12:19:32 +02:00
|
|
|
|
2024-12-07 00:43:56 +01:00
|
|
|
$request = wp_remote_get($api_url . "package/" . $repo . "/" . $package . "/" . $arch, $get_args);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (is_wp_error($request)) {
|
2024-08-11 17:57:04 +02:00
|
|
|
echo "<div class=\"errorbox\">ERROR: " . $request->get_error_message() . "</div>";
|
2024-07-11 01:00:53 +02:00
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2024-06-01 22:31:12 +02:00
|
|
|
$j = json_decode($request["body"],true);
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["error"])) {
|
2024-06-29 14:04:42 +02:00
|
|
|
echo "<h3>" . _r("ERROR") . ": " . $j["error"] . "</h3>";
|
2024-06-02 12:19:32 +02:00
|
|
|
} else {
|
|
|
|
echo " > <a href=\"" . $url_prefix . "/" . $repo . "\">$repo</a> > " . $package . " (" . $arch . ")";
|
|
|
|
|
2024-06-01 22:31:12 +02:00
|
|
|
?>
|
|
|
|
|
2024-06-29 14:04:42 +02:00
|
|
|
<div class="box" style="float:right;min-width:150px;padding:10px;">
|
|
|
|
<b><?php echo _r("Resources") ?>:</b><br/>
|
|
|
|
<a href="<?php echo $j["source"]["source_url"] ?>" target=_blank><?php echo _r("Source files") ?></a> |
|
|
|
|
<a href="<?php echo $j["source"]["source_url"] ?>/commits/branch/main" target=_blank><?php echo _r("Changes") ?></a><br/>
|
|
|
|
<a href="<?php echo $j["source"]["source_url"] ?>/issues" target=_blank><?php echo _r("Issues") ?></a> |
|
|
|
|
<a href="<?php echo $j["source"]["source_url"] ?>/issues/new" target=_blank><?php echo _r("Add a new issue") ?></a><br/>
|
|
|
|
<a href="<?php echo $j["download_url"] ?>" target=_blank><?php echo _r("Download") ?></a>
|
|
|
|
</div>
|
|
|
|
|
2024-06-02 12:19:32 +02:00
|
|
|
<h1><img src="https://www.google.com/s2/favicons?domain=<?php echo $j["source"]["url"] ?>" width="24" height="24">
|
|
|
|
<?php echo $j["name"] ?>: <?php echo $j["summary"] ?></h1>
|
2024-06-01 22:31:12 +02:00
|
|
|
|
2024-07-07 14:56:17 +02:00
|
|
|
<?php echo nl2br($j["description"]) ?>
|
2024-07-07 14:23:16 +02:00
|
|
|
|
2024-06-01 22:31:12 +02:00
|
|
|
<table class="pkgpage" width="100%">
|
2024-06-29 14:04:42 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Name") ?>:</td><td><?php echo $j["name"] ?></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("Release") ?>:</td><td>
|
2024-06-01 22:31:12 +02:00
|
|
|
<?php if ($j["source"]["epoch"] != "0") echo $j["source"]["epoch"].":";
|
|
|
|
echo $j["source"]["version"]."-".$j["source"]["release"] ?></td></tr>
|
2024-06-29 14:04:42 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Architecture") ?>:</td><td><?php echo $j["arch"] ?></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("Group") ?>:</td><td><?php echo $j["group"] ?></td></tr>
|
2024-07-07 16:05:16 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Size") ?>:</td><td><?php echo human_filesize($j["size"]) ?></td></tr>
|
2024-06-29 14:04:42 +02:00
|
|
|
<tr><td width="15%"><?php echo _r("Upstream URL") ?>:</td><td><a href="<?php echo $j["source"]["url"] ?>" target=_blank><?php echo $j["source"]["url"] ?></a></td></tr>
|
|
|
|
<tr><td width="15%"><?php echo _r("Source RPM") ?>:</td><td><?php
|
2024-06-02 12:19:32 +02:00
|
|
|
$sourcerpm_url = $url_prefix . $repo . "/" . $j["source"]["name"];
|
|
|
|
echo "<a href=\"". $sourcerpm_url . "\">". $j["source"]["name"] . "</a> "; ?>
|
2024-06-01 22:31:12 +02:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<?php
|
2024-07-07 14:56:17 +02:00
|
|
|
|
|
|
|
// RPM provides, requires, obsoletes table
|
|
|
|
echo "<table class=\"pkgpage\" width=\"100%\"><tr><th>" .
|
|
|
|
_r("Brothers") . "</th><th>" . _r("Provides") . "</th><th>" .
|
2024-11-03 12:29:43 +01:00
|
|
|
_r("Obsoletes") . "</th><th>" . _r("Requires") . "</th><th>" .
|
|
|
|
_r("Recommends") . "</th></tr>";
|
2024-07-07 14:56:17 +02:00
|
|
|
echo "<tr><td>";
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["brothers"])) {
|
|
|
|
foreach ($j["brothers"] as $brother) {
|
|
|
|
$brother_url = $url_prefix . $repo . "/" . $brother . "/" . $arch;
|
|
|
|
echo "<a href=\"". $brother_url . "\">". $brother . "</a><br/>";
|
|
|
|
}
|
2024-07-07 14:56:17 +02:00
|
|
|
}
|
|
|
|
echo "</td><td>";
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["provides"])) {
|
|
|
|
foreach ($j["provides"] as $provide) {
|
|
|
|
echo $provide["name"];
|
|
|
|
if ($provide["flags"] != "") echo " " . $provide["flags"] . " " . $provide["version"];
|
|
|
|
echo "<br/>";
|
|
|
|
}
|
2024-07-07 14:56:17 +02:00
|
|
|
}
|
|
|
|
echo "</td><td>";
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["obsoletes"])) {
|
|
|
|
foreach ($j["obsoletes"] as $obsolete) {
|
|
|
|
echo $obsolete["name"];
|
|
|
|
if ($obsolete["flags"] != "") echo " " . $obsolete["flags"] . " " . $obsolete["version"];
|
|
|
|
echo "<br/>";
|
|
|
|
}
|
2024-07-07 14:56:17 +02:00
|
|
|
}
|
|
|
|
echo "</td><td>";
|
2024-07-11 01:00:53 +02:00
|
|
|
if (isset($j["requires"])) {
|
|
|
|
foreach ($j["requires"] as $require) {
|
|
|
|
echo $require["name"];
|
|
|
|
if ($require["flags"] != "") echo " " . $require["flags"] . " " . $require["version"];
|
|
|
|
|
|
|
|
$cnt = 0;
|
|
|
|
if (isset($require["providers"])) {
|
|
|
|
foreach ($require["providers"] as $provider) {
|
2024-11-03 12:29:43 +01:00
|
|
|
$cnt++;
|
|
|
|
$provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch;
|
|
|
|
echo " <a href=\"" . $provider_url . "\">[" . $cnt . "]</a>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($cnt == 0) echo " <font color=red>(" . _r("unresolved") . ")</font>";
|
|
|
|
echo "<br/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</td><td>";
|
|
|
|
if (isset($j["recommends"])) {
|
|
|
|
foreach ($j["recommends"] as $require) {
|
|
|
|
echo $require["name"];
|
|
|
|
if ($require["flags"] != "") echo " " . $require["flags"] . " " . $require["version"];
|
|
|
|
|
|
|
|
$cnt = 0;
|
|
|
|
if (isset($require["providers"])) {
|
|
|
|
foreach ($require["providers"] as $provider) {
|
2024-07-11 01:00:53 +02:00
|
|
|
$cnt++;
|
|
|
|
$provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch;
|
|
|
|
echo " <a href=\"" . $provider_url . "\">[" . $cnt . "]</a>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($cnt == 0) echo " <font color=red>(" . _r("unresolved") . ")</font>";
|
|
|
|
echo "<br/>";
|
2024-07-07 14:56:17 +02:00
|
|
|
}
|
2024-06-02 12:19:32 +02:00
|
|
|
}
|
2024-07-07 14:56:17 +02:00
|
|
|
echo "</td></tr></table>";
|
2024-08-11 17:57:04 +02:00
|
|
|
|
|
|
|
// Package files list
|
|
|
|
echo "<span id=\"fileslist\" class=\"collapseomatic colomat-close colomat-visited\"" .
|
|
|
|
"tabindex=\"0\" title=\"" . _r("Provided files") . "\">" . _r("Provided files") . "</span>";
|
|
|
|
|
|
|
|
echo "<div id=\"target-fileslist\" class=\"collapseomatic_content bggray\" style=\"display:none\">";
|
|
|
|
if (isset($j["files"])) {
|
|
|
|
foreach ($j["files"] as $file) {
|
|
|
|
echo $file["path"] . "<br/>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</div>";
|
|
|
|
|
2024-06-01 22:31:12 +02:00
|
|
|
}
|
2024-07-07 14:56:17 +02:00
|
|
|
}
|
2024-06-01 22:31:12 +02:00
|
|
|
?>
|
|
|
|
|
2024-07-11 01:00:53 +02:00
|
|
|
<?php finish: ?>
|
2024-06-02 12:19:32 +02:00
|
|
|
</span></div><!-- end of #content-full -->
|
2024-06-01 22:31:12 +02:00
|
|
|
|
|
|
|
<?php get_footer(); ?>
|