Home"; $repo=get_query_var('repo'); $package=get_query_var('package'); $arch=get_query_var('arch'); if ($repo == "") { // // Repositories // echo " > " . _r("Repositories"); echo "

" . _r("Available repositories") . ":

"; $request = wp_remote_get($api_url . "repositories"); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; } $j = json_decode($request["body"], true); foreach ($j as $repository) { $repository_url = $url_prefix . $repository["tag"]; echo "". $repository["tag"] . ": " . $repository["description"] . "
"; } } else if ($package == "") { // // Repository // echo " > Repositories"; $page = isset($_GET['page'])?$_GET['page']:""; $q = isset($_GET['q'])?$_GET['q']:""; $query_append = ""; if ($page != "") $query_append .="&page=" . $page; if ($q != "") $query_append .= "&q=" . urlencode($q); if (strlen($query_append) > 0 && $query_append[0] == '&') $query_append[0] = "?"; $request = wp_remote_get($api_url . "repository/" . $repo . $query_append); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; } $j = json_decode($request["body"], true); if (isset($j["error"])) { echo "
ERROR: " . $j["error"] . "
"; } else { echo " > " . $repo; echo "

" . _r("List of packages") . ":

"; echo "
"; echo ""; echo " - "; if ($q != "") echo _r("Results for:") . " " . $q . " - "; // Pagination $pagination = ""; if ($j["query"]["pages"]) { $query_append = ""; if ($q != "") $query_append .= "&q=" . urlencode($q); $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; } $pagination .= "" . $j["query"]["total"] . " " . _r("result(s) found") . " - " . _r("Showing page") . " " . $page . " " . _r("of") . " " . $pages . " [ "; if ($from_page > 1) { $back_page = $from_page - 10; if ($back_page < 1) $back_page = 1; $pagination .= "< "; } $prev_page = ""; $next_page = ""; for ($i = $from_page; $i <= $to_page; $i++) { if ($i != $j["query"]["page"]) { $pagination .= "" . $i . " "; if ($i == $j["query"]["page"]+1) $next_page = $i; } else { if ($i >= 2 && $prev_page == "") $prev_page = $i - 1; $pagination .= "" . $i . " "; } } if ($to_page < $pages) { $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 .= "> "; } $pagination .= "]
"; if ($prev_page != "") { $pagination .= "< " . _r("Prev") . " "; } if ($next_page != "") { $pagination .= "  " . _r("Next") . " > "; } $pagination .= "
"; } else { $pagination .= "0 " . _r("result(s) found"); } echo $pagination; echo ""; foreach ($j["packages"] as $package) { $package_url = $url_prefix . $repo . "/" . $package["name"]; if ($package["arch"] != "src") $package_url .= "/" . $package["arch"]; echo ""; } echo "
" . _r("Arch") . "" . _r("Name") . "" . _r("Version") . "" . _r("Summary") . "" . _r("Last update") . "
" . $package["arch"] . "" . "". $package["name"] . "" . $package["version"] . "-" . $package["release"] . "" . $package["summary"] . "" . substr($package["buildtime"], 0, 10) . "
"; echo $pagination; echo "
"; } } else if ($arch == "") { // // Source package // echo " > " . _r("Repositories") . ""; $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package); if (is_wp_error($request)) { echo "

ERROR: " . $request->get_error_message() . "

"; goto finish; } $j = json_decode($request["body"], true); if (isset($j["error"])) { echo "

" . _r("ERROR") . ": " . $j["error"] . "

"; } else { echo " > $repo > " . $package; ?>

" width="24" height="24"> :

:
:
:
:
:
:
:" target=_blank>
:
" . _r("Binary packages and requirements") . ""; echo ""; foreach ($j["children"]["archs"] as $arch => $value) { echo ""; } echo ""; foreach ($j["children"]["archs"] as $arch => $value) { echo ""; } echo ""; foreach ($j["children"]["archs"] as $arch => $value) { echo ""; } echo "
" . $arch . "
" . _r("Built RPMS") . ""; foreach ($j["children"]["archs"][$arch] as $child) { $child_url = $url_prefix . $repo . "/" . $child["name"] . "/" . $arch; echo "" . $child["name"] . "
"; } echo "
" . _r("Build requirements") . ""; foreach ($j["buildrequires"] as $buildrequire) { echo $buildrequire["name"]; if ($buildrequire["flags"] != "") echo "[" . $buildrequire["flags"] . $buildrequire["version"] . "]"; $cnt = 0; if (isset($buildrequire["providers"]["archs"][$arch])) { foreach ($buildrequire["providers"]["archs"][$arch] as $provider) { $cnt++; $provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch; echo " [" . $cnt . "]"; } } if ($cnt == 0) echo " (" . _r("unresolved") . ")"; echo "
"; } echo "
"; // Changelog echo "
" . _r("History of changes") . "
"; echo ""; foreach ($j["changelog"] as $changelog) { echo ""; } echo "
" . _r("Date") . "" . _r("Packager") . "" . _r("Release") . "" . _r("Description") . "
" . substr($changelog["date"],0,10) . "" . $changelog["packager"] . "" . $changelog["release"] . "" . nl2br($changelog["text"]) . "
"; ?> " . _r("Repositories") . ""; $request = wp_remote_get($api_url . "package/" . $repo . "/" . $package . "/" . $arch, array('timeout' => 15)); if (is_wp_error($request)) { echo "
ERROR: " . $request->get_error_message() . "
"; goto finish; } $j = json_decode($request["body"],true); if (isset($j["error"])) { echo "

" . _r("ERROR") . ": " . $j["error"] . "

"; } else { echo " > $repo > " . $package . " (" . $arch . ")"; ?>

" width="24" height="24"> :

:
:
:
:
:
:" target=_blank>
:". $j["source"]["name"] . " "; ?>
" . _r("Brothers") . "" . _r("Provides") . "" . _r("Obsoletes") . "" . _r("Requires") . "" . _r("Recommends") . ""; echo ""; if (isset($j["brothers"])) { foreach ($j["brothers"] as $brother) { $brother_url = $url_prefix . $repo . "/" . $brother . "/" . $arch; echo "". $brother . "
"; } } echo ""; if (isset($j["provides"])) { foreach ($j["provides"] as $provide) { echo $provide["name"]; if ($provide["flags"] != "") echo " " . $provide["flags"] . " " . $provide["version"]; echo "
"; } } echo ""; if (isset($j["obsoletes"])) { foreach ($j["obsoletes"] as $obsolete) { echo $obsolete["name"]; if ($obsolete["flags"] != "") echo " " . $obsolete["flags"] . " " . $obsolete["version"]; echo "
"; } } echo ""; 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) { $cnt++; $provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch; echo " [" . $cnt . "]"; } } if ($cnt == 0) echo " (" . _r("unresolved") . ")"; echo "
"; } } echo ""; 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) { $cnt++; $provider_url = $url_prefix . $provider["repository"] . "/" . $provider["name"] . "/" . $arch; echo " [" . $cnt . "]"; } } if ($cnt == 0) echo " (" . _r("unresolved") . ")"; echo "
"; } } echo ""; // Package files list echo "" . _r("Provided files") . ""; echo "
"; if (isset($j["files"])) { foreach ($j["files"] as $file) { echo $file["path"] . "
"; } } echo "
"; } } ?>