function Package() { $config = array("server" => array('short' => 's', 'max' => 1, 'min' => 1, 'desc' => "server URL", 'default' => ""), "package" => array('short' => 'p', 'max' => 1, 'min' => 1, 'desc' => "package name"), "debug" => array('short' => 'd', 'max' => 1, 'min' => 1, 'desc' => "debug level", 'default' => "0"), "refresh" => array('short' => 'r', 'max' => 1, 'min' => 1, 'desc' => "refresh cache", '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')), 'server' => $args->getValue('server'))); $rep = $client->getPackageInfo($args->getValue('package'), intval($args->getValue('refresh'))); if (!$rep) { die("Package not found\n"); } $first = true; foreach ($rep as $branch => $pack) { if ($first) { $first = false; echo 'Name: ' . $pack['package']['name'] . "\n"; echo 'Summary: ' . $pack['package']['summary'] . "\n"; echo 'PkgDB: ' . $client->getPackageURL($pack['package']['name']) . "\n"; echo "Description:\n" . $pack['package']['description'] . "\n"; } echo $branch . ":\t" . $pack['owner']; $i = 0; $tmp = $pack['people']; if (count($tmp)) { sort($tmp); echo " (" . implode($tmp, ', ') . ")\n"; } else { echo "\n"; } } }
if ($up && $up['unstable'] && $up['stable'] != $up['unstable']) { $summary['Unstable version'] = $up['unstable']; if ($up['state']) { $summary['Unstable version'] .= ' (' . $up['state'] . ')'; } } if ($owner && $owner->owner) { $summary['Owner'] = $owner->owner; if ($owner->cc) { $summary['Owner'] .= ' (' . $owner->cc . ')'; } // Only when owner (so we have the exact name) $summary['Bugzilla'] = 'https://bugzilla.redhat.com/buglist.cgi' . '?bug_status=NEW&bug_status=ASSIGNED&bug_status=ON_QA' . '&component=' . $name; } $summary['GitWeb'] = 'http://pkgs.fedoraproject.org/cgit/' . $name . '.git'; $summary['PkgDB'] = $fedcli->getPackageURL($name); if (isset($_GET['pkgdb'])) { $fedpkg = $fedcli->getPackageInfo($name); } else { $fedpkg = false; } $i = 0; $prev = false; do { if ($rpm->location) { $rpm->rpmurl = $rpm->repourl . $rpm->location; } $rpm->askpkgdb = false; if ($rpm->active && (substr($rpm->repo_main, 0, 1) == 'f' || substr($rpm->repo_sub, 0, 4) == 'epel')) { $rpm->askpkgdb = true; }