summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-05-28 20:25:18 +0200
committerRemi Collet <fedora@famillecollet.com>2010-05-28 20:25:18 +0200
commit450d53ef1f48c1fc913d81603103e86a3c08bc83 (patch)
tree75c1313390319511d296f73dd8346dec79e9e1fe
parent5b1352c533fc867026f4b47d3de124388819e885 (diff)
Display pkgdb info on package info page
-rw-r--r--FedoraClient.php6
-rw-r--r--css/rpmphp.css1
-rw-r--r--zoom.php38
3 files changed, 42 insertions, 3 deletions
diff --git a/FedoraClient.php b/FedoraClient.php
index 516f54b..fe2d26c 100644
--- a/FedoraClient.php
+++ b/FedoraClient.php
@@ -35,7 +35,11 @@ abstract class FedoraClient {
protected $cache;
function __construct ($url, array $options) {
- $this->cache = new Cache_Lite(array('memoryCaching'=>true, 'automaticSerialization'=>true));
+ $dir = "/tmp/cachelite-".posix_getlogin()."/";
+ @mkdir($dir);
+ $this->cache = new Cache_Lite(array('memoryCaching' => true,
+ 'cacheDir' => $dir,
+ 'automaticSerialization'=> true));
$this->url = $url;
if (isset($options['agent']) && !empty($options['agent'])) {
diff --git a/css/rpmphp.css b/css/rpmphp.css
index 33e7f64..af1b8fc 100644
--- a/css/rpmphp.css
+++ b/css/rpmphp.css
@@ -148,6 +148,7 @@ p{
#list-packages td,
#list-packages th{
+ text-align: left;
padding:.2em;
background-color:white;
}
diff --git a/zoom.php b/zoom.php
index f3c8bf8..09f37f4 100644
--- a/zoom.php
+++ b/zoom.php
@@ -1,6 +1,10 @@
<?php
require "config.inc.php";
+require "FedoraClient.php";
+
+$fedcli = new FedoraPkgdb();
+
if (!isset($_GET['rpm'])) {
die("missing arg.");
}
@@ -57,7 +61,16 @@ if (!$name) {
if (!$rpm) {
echo "<h1>$name not found</h1>\n";
} else {
+
echo "<h1>Package: $name</h1>\n";
+
+ if (isset($_GET['pkgdb'])) {
+ $fedpkg = $fedcli->getPackageInfo($name);
+ echo "<p><a href='".$_SERVER['PHP_SELF']."?rpm=$name'>Hide pkgdb informations</a></p>";
+ } else {
+ $fedpkg = false;
+ echo "<p><a href='".$_SERVER['PHP_SELF']."?rpm=$name&amp;pkgdb=1'>Show more informations from pkgdb</a></p>";
+ }
echo "<table id=\"upstream\">\n";
echo "<caption>Upstream info</caption>\n";
$i=0;
@@ -69,6 +82,10 @@ if (!$name) {
echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
echo "Summary: </th><td><strong>". $owner->summary . "</strong></td></tr>\n";
}
+ if (isset($fedpkg['devel']['package']['description'])) {
+ echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
+ echo "Description: </th><td>".$fedpkg['devel']['package']['description']."</td></tr>\n";
+ }
if ($rpm->url) {
echo "<tr class='".($i%2 ? 'odd' : 'even')."'><th>"; $i++;
echo "URL: </th><td><strong><a href='".$rpm->url."'>". $rpm->url . "</a></strong></td></tr>\n";
@@ -109,15 +126,32 @@ if (!$name) {
echo "<table id=\"list-packages\">\n";
echo "<caption>Packages available in Fedora Repositories</caption>\n";
+ echo "<thead><tr><th>Branch</th><th>Repository</th><th>Version-Release</th><th>Owner</th><th>Co-maintainers</th></tr></thead><tbody>\n";
$prev=false;
do {
+ if ($rpm->repo_main=='rawhide' && isset($fedpkg['devel']['owner'])) {
+ $owner = $fedpkg['devel']['owner'];
+ $people = $fedpkg['devel']['people'];
+ } else if (isset($fedpkg[$rpm->repo_main]['owner'])) {
+ $owner = $fedpkg[$rpm->repo_main]['owner'];
+ $people = $fedpkg[$rpm->repo_main]['people'];
+ } else {
+ $owner ="&nbsp;";
+ $people = false;
+ }
+ $comaint = '';
+ if ($people) foreach ($people as $user) {
+ if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) {
+ $comaint .= $user['username'];
+ }
+ }
echo "<tr class='".($i%2 ? 'odd' : 'even')."'>"; $i++;
echo "<td><strong>".($rpm->repo_main==$prev ? "&nbsp;" : $prev=$rpm->repo_main)."</strong></td>";
echo "<td>".$rpm->repo_sub."</td>";
echo "<td>".($rpm->epoch ? $rpm->epoch.":" : "").$rpm->ver."-".$rpm->rel."</td>";
- echo "</tr>\n";
+ echo "<td>$owner</td><td>$comaint</td></tr>\n";
} while ($rpm = $resrpm->fetchObject());
- echo "</table>";
+ echo "</tbody></table>";
}
}
catch(PDOException $e) {