summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FedoraClient.php13
-rwxr-xr-xfedcli.php18
2 files changed, 31 insertions, 0 deletions
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();