summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-05-16 18:46:56 +0200
committerRemi Collet <fedora@famillecollet.com>2014-05-16 18:46:56 +0200
commit0c3aa4390ff734a6cba4f04929493e19de285522 (patch)
tree497d3730d64f0b5b01a96557a041b763f95a0384
parentd84a48e948b80ecca27e6b8d9e301a1489f33647 (diff)
fix link to pkgdb2
-rw-r--r--class/FedoraPkgdb.php14
-rwxr-xr-xfedcli.php1
2 files changed, 8 insertions, 7 deletions
diff --git a/class/FedoraPkgdb.php b/class/FedoraPkgdb.php
index afe7adc..9bbdfd5 100644
--- a/class/FedoraPkgdb.php
+++ b/class/FedoraPkgdb.php
@@ -46,13 +46,13 @@ class FedoraPkgdb extends FedoraClient
} else {
$server = 'admin.fedoraproject.org';
}
- parent::__construct("https://$server/pkgdb/api/", $options);
+ parent::__construct("https://$server/pkgdb/", $options);
$rep = $this->cache->get(__METHOD__, $this->url);
if ($rep!==false) {
$this->logDebug(2, __METHOD__."() get from cache");
} else {
- $rep =$this->sendRequest('version');
+ $rep =$this->sendRequest('api/version');
$this->cache->save($rep, __METHOD__, $this->url);
$this->logDebug(2, __METHOD__."() save to cache"
);
@@ -78,7 +78,7 @@ class FedoraPkgdb extends FedoraClient
if ($rep) {
$this->logDebug(2, __METHOD__."() get from cache");
} else {
- $rep =$this->sendRequest('collections');
+ $rep =$this->sendRequest('api/collections');
$this->cache->save($rep, __METHOD__, $this->url);
$this->logDebug(2, __METHOD__."() save to cache");
}
@@ -104,7 +104,7 @@ class FedoraPkgdb extends FedoraClient
function getPackageURL($name)
{
- return $this->url.'acls/name/'.$name;
+ return $this->url.'package/'.urlencode($name);
}
function getPackageInfo($name, $refresh=false)
@@ -115,7 +115,7 @@ class FedoraPkgdb extends FedoraClient
'el6' => 'EL-6',
'epel7' => 'EL-7',
);
- $url='package/'.urlencode($name);
+ $url='api/package/'.urlencode($name);
$rep = ($refresh ? false : $this->cache->get(__METHOD__, $this->url.$url));
if ($rep) {
$this->logDebug(2, __METHOD__."($name) get from cache");
@@ -151,7 +151,7 @@ class FedoraPkgdb extends FedoraClient
function getBranch($name, $refresh=false)
{
if ($this->_version > 0) {
- $url='collections/'.urlencode($name).'/';
+ $url='api/collections/'.urlencode($name).'/';
$rep = ($refresh ? false : $this->cache->get(__METHOD__, $this->url.$url));
if ($rep) {
$this->logDebug(2, __METHOD__."($name) get from cache");
@@ -173,7 +173,7 @@ class FedoraPkgdb extends FedoraClient
function getCritPath($refresh=false)
{
if ($this->_version > 0) {
- $url="critpath";
+ $url="api/critpath";
$rep = ($refresh ? false : $this->cache->get(__METHOD__, $this->url));
if ($rep) {
$this->logDebug(2, __METHOD__."() get from cache");
diff --git a/fedcli.php b/fedcli.php
index f0bd914..88c65ca 100755
--- a/fedcli.php
+++ b/fedcli.php
@@ -127,6 +127,7 @@ function Package() {
$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'];