diff options
-rw-r--r-- | FedoraClient.php | 6 | ||||
-rwxr-xr-x | fedcli.php | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/FedoraClient.php b/FedoraClient.php index 1d0ce71..9aec851 100644 --- a/FedoraClient.php +++ b/FedoraClient.php @@ -149,7 +149,11 @@ class FedoraPkgdb extends FedoraClient { $this->logDebug(1,__CLASS__."::".__FUNCTION__."($name) ".$rep['message']); return false; } - return $rep; + $branches = array(); + foreach ($rep['packageListings'] as $pack) { + $branches[$pack['collection']['branchname']] = $pack; + } + return $branches; } function getBranch($name, $refresh=false) { @@ -87,17 +87,16 @@ function Package() { if (!$rep) { die("Package not found\n"); } - if (isset($rep['title'])) { - echo $rep['title']."\n"; - } + $first = true; - foreach ($rep['packageListings'] as $pack) { + foreach ($rep as $branch => $pack) { if ($first) { $first = false; - echo 'Summary: '.$pack['package']['summary']."\n"; - echo 'Description: '.$pack['package']['description']."\n"; + echo 'Name: '.$pack['package']['name']."\n"; + echo 'Summary: '.$pack['package']['summary']."\n"; + echo "Description:\n".$pack['package']['description']."\n"; } - echo $pack['collection']['branchname'].": ".$pack['owner']; + echo $branch.":\t".$pack['owner']; $i=0; foreach ($pack['people'] as $user) { |