summaryrefslogtreecommitdiffstats
path: root/fedcli.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-05-23 18:35:55 +0200
committerRemi Collet <fedora@famillecollet.com>2010-05-23 18:35:55 +0200
commitfafd3ef12512c7a7832a93de14b668bed1922f1c (patch)
treec79f755cdeed3d7359dfd075d03187620d8f2f57 /fedcli.php
parentbc796fd68e1faae3260c186ac446c3a75ac1ecf5 (diff)
add FedoraPkgdb->getPackageInfo()
Diffstat (limited to 'fedcli.php')
-rwxr-xr-xfedcli.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/fedcli.php b/fedcli.php
index d8439ff..81bff3d 100755
--- a/fedcli.php
+++ b/fedcli.php
@@ -30,7 +30,9 @@ function Help() {
echo "\nFedora Client Command Line usage\n\n";
echo "fdcli command options\n";
+ echo "\tbranch: branch info\n";
echo "\tbranches: list branches\n";
+ echo "\tpackage: package info\n";
echo "\tversion: class version\n";
echo "Also try fdcli command --help\n";
}
@@ -69,6 +71,44 @@ function Branch() {
print_r($branch);
}
+function Package() {
+ $config = array(
+ "package" => array('short' => 'p', 'max' => 1, 'min' => 1, 'desc' => "package name"),
+ "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'))));
+ $rep = $client->getPackageInfo($args->getValue('package'));
+
+ if (!$rep) {
+ die("Package not found\n");
+ }
+ if (isset($rep['title'])) {
+ echo $rep['title']."\n";
+ }
+ $first = true;
+ foreach ($rep['packageListings'] as $pack) {
+ if ($first) {
+ $first = false;
+ echo 'Summary: '.$pack['package']['summary']."\n";
+ echo 'Description: '.$pack['package']['description']."\n";
+ }
+ echo $pack['collection']['branchname'].": ".$pack['owner'];
+
+ $i=0;
+ foreach ($pack['people'] as $user) {
+ if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) {
+ echo ($i++ ? ", " : " (").$user['username'];
+ }
+ }
+ echo ($i ? ")\n" : "\n");
+ }
+}
+
function Version() {
$config = array(
"debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0")
@@ -88,6 +128,7 @@ $cmd = array_shift($_SERVER['argv']);
switch ($cmd) {
case 'branches': Branches(); break;
case 'branch': Branch(); break;
+ case 'package': Package(); break;
case 'version': Version(); break;
default: Help();
}