From 9e248007a16986a02fbfc269addb01de07ee427b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 25 May 2010 05:28:34 +0800 Subject: add FedoraPkgdb->getCritPath()... well seems it doesn't work :( --- FedoraClient.php | 13 +++++++++++++ fedcli.php | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/FedoraClient.php b/FedoraClient.php index bd91056..516f54b 100644 --- a/FedoraClient.php +++ b/FedoraClient.php @@ -164,5 +164,18 @@ class FedoraPkgdb extends FedoraClient { } return false; } + + function getCritPath($refresh=false) { + $url="lists/critpath"; + $rep = ($refresh ? false : $this->cache->get($url,__CLASS__)); + if ($rep) { + $this->logDebug(2,__CLASS__."::".__FUNCTION__." get from cache"); + } else { + $rep =$this->sendRequest($url); + $this->cache->save($rep,$url,__CLASS__); + $this->logDebug(2,__CLASS__."::".__FUNCTION__." save to cache"); + } + return $rep['pkgs']; + } } ?> diff --git a/fedcli.php b/fedcli.php index a58d47a..ce9c31a 100755 --- a/fedcli.php +++ b/fedcli.php @@ -32,6 +32,7 @@ function Help() { echo "fdcli command options\n"; echo "\tbranch: branch info\n"; echo "\tbranches: list branches\n"; + echo "\tcritpath: list critical path\n"; echo "\tpackage: package info\n"; echo "\tversion: class version\n"; echo "Also try fdcli command --help\n"; @@ -71,6 +72,22 @@ function Branch() { print_r($branch); } +function CritPath() { + $config = array( + //"branch" => array('short' => 'b', 'max' => 1, 'min' => 1, 'desc' => "branch name", 'default' => "devel"), + "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0") + ); + $args =& Console_Getargs::factory($config); + + if (PEAR::isError($args)) { + die (Console_Getargs::getHelp($config)); + } + + $client = new FedoraPkgdb(array('debug' => intval($args->getValue('debug')))); + $branch = $client->getCritPath(); + print_r($branch); +} + function Package() { $config = array( "package" => array('short' => 'p', 'max' => 1, 'min' => 1, 'desc' => "package name"), @@ -127,6 +144,7 @@ $cmd = array_shift($_SERVER['argv']); switch ($cmd) { case 'branches': Branches(); break; case 'branch': Branch(); break; + case 'critpath': CritPath(); break; case 'package': Package(); break; case 'version': Version(); break; default: Help(); -- cgit From d4db37b22442597d3caef906b97b47f7e289184a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 28 May 2010 00:21:54 +0800 Subject: minor fix (no upstream column in all list) --- all.php | 1 - 1 file changed, 1 deletion(-) diff --git a/all.php b/all.php index 08e6618..2b32a5b 100644 --- a/all.php +++ b/all.php @@ -199,7 +199,6 @@ try { Package Owner(s) - Upstream Date: Sat, 29 May 2010 02:25:18 +0800 Subject: Display pkgdb info on package info page --- FedoraClient.php | 6 +++++- css/rpmphp.css | 1 + zoom.php | 38 ++++++++++++++++++++++++++++++++++++-- 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 @@ $name not found\n"; } else { + echo "

Package: $name

\n"; + + if (isset($_GET['pkgdb'])) { + $fedpkg = $fedcli->getPackageInfo($name); + echo "

Hide pkgdb informations

"; + } else { + $fedpkg = false; + echo "

Show more informations from pkgdb

"; + } echo "\n"; echo "\n"; $i=0; @@ -69,6 +82,10 @@ if (!$name) { echo "\n"; } + if (isset($fedpkg['devel']['package']['description'])) { + echo "\n"; + } if ($rpm->url) { echo "\n"; @@ -109,15 +126,32 @@ if (!$name) { echo "
Upstream info
"; $i++; echo "Summary: ". $owner->summary . "
"; $i++; + echo "Description: ".$fedpkg['devel']['package']['description']."
"; $i++; echo "URL: ". $rpm->url . "
\n"; echo "\n"; + echo "\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 ""; $i++; echo ""; echo ""; echo ""; - echo "\n"; + echo "\n"; } while ($rpm = $resrpm->fetchObject()); - echo "
Packages available in Fedora Repositories
BranchRepositoryVersion-ReleaseOwnerCo-maintainers
".($rpm->repo_main==$prev ? " " : $prev=$rpm->repo_main)."".$rpm->repo_sub."".($rpm->epoch ? $rpm->epoch.":" : "").$rpm->ver."-".$rpm->rel."
$owner$comaint
"; + echo ""; } } catch(PDOException $e) { -- cgit From afcf0d9d405ce6cabeedbc1352fb651ef8eb47e7 Mon Sep 17 00:00:00 2001 From: "Johan \"Papa\" Cwiklinski" Date: Sat, 29 May 2010 10:58:14 +0200 Subject: White table lines should have a border toowq --- css/rpmphp.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/css/rpmphp.css b/css/rpmphp.css index af1b8fc..0b99b7f 100644 --- a/css/rpmphp.css +++ b/css/rpmphp.css @@ -158,10 +158,12 @@ p{ border-bottom:1px solid #bbb; } +#list-packages tbody td{ + border-bottom:1px solid #DDDDDD; +} + #list-packages tbody tr.odd td{ background-color:#F0F0F0; - border-bottom:1px solid #DDDDDD; - border-top:1px solid #DDDDDD; } #list-packages h2{ -- cgit