diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-05-29 02:25:18 +0800 |
---|---|---|
committer | trasher <trasher@x-tnd.be> | 2010-05-29 16:44:58 +0800 |
commit | 2e536ba1dc043568ef443f2177657e43527d35b1 (patch) | |
tree | 75c1313390319511d296f73dd8346dec79e9e1fe /zoom.php | |
parent | d4db37b22442597d3caef906b97b47f7e289184a (diff) |
Display pkgdb info on package info page
Diffstat (limited to 'zoom.php')
-rw-r--r-- | zoom.php | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -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&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 =" "; + $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 ? " " : $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) { |