From d84a48e948b80ecca27e6b8d9e301a1489f33647 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 15 May 2014 09:28:35 +0200 Subject: pkgdb2 compatibility, ++, bump fedpkg cli version to 0.3.0-dev --- all.php | 4 ++-- autocompleter.php | 4 ++-- class/CommonTable.php | 4 ++-- class/FedoraClient.php | 6 +++--- class/FedoraPkgdb.php | 42 ++++++++++++++++++++++-------------------- class/Parser.php | 4 ++-- class/TableAcls.php | 4 ++-- class/TableIterator.php | 4 ++-- class/TablePearRepo.php | 4 ++-- class/TableRRepo.php | 4 ++-- class/TableRpm.php | 4 ++-- class/TableRpmRepo.php | 4 ++-- class/TableUpstream.php | 4 ++-- fedcli.php | 9 ++------- include/config.php.dist | 4 ++-- include/main.php | 4 ++-- index.php | 4 ++-- pkgdb-ajax.php | 15 +++------------ refresh.php | 4 ++-- rpm.php | 4 ++-- zoom.php | 15 +++------------ 21 files changed, 65 insertions(+), 86 deletions(-) diff --git a/all.php b/all.php index f45f4dc..6eeba7a 100644 --- a/all.php +++ b/all.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/autocompleter.php b/autocompleter.php index 5dbcd5a..38e9d4e 100644 --- a/autocompleter.php +++ b/autocompleter.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/CommonTable.php b/class/CommonTable.php index 365ef19..ab06cfd 100644 --- a/class/CommonTable.php +++ b/class/CommonTable.php @@ -4,7 +4,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -26,7 +26,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/FedoraClient.php b/class/FedoraClient.php index 4071348..a356a9b 100644 --- a/class/FedoraClient.php +++ b/class/FedoraClient.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright (C) 2010 Remi Collet + * Copyright (C) 2010-2014 Remi Collet * http://github.com/remicollet/rpmphp. * * Inspired from python-fedora @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010-2013 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/lgpl-2.1.txt LGPL License 2.1 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. @@ -42,7 +42,7 @@ require_once 'Cache/Lite.php'; abstract class FedoraClient { - const VERSION='0.2.0-dev'; + const VERSION='0.3.0-dev'; protected $url; private $_agent; private $_debug = 0; diff --git a/class/FedoraPkgdb.php b/class/FedoraPkgdb.php index 1650493..afe7adc 100644 --- a/class/FedoraPkgdb.php +++ b/class/FedoraPkgdb.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright (C) 2010-2013 Remi Collet + * Copyright (C) 2010-2014 Remi Collet * http://github.com/remicollet/rpmphp. * * Inspired from python-fedora @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010-2013 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/lgpl-2.1.txt LGPL License 2.1 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. @@ -46,7 +46,7 @@ class FedoraPkgdb extends FedoraClient } else { $server = 'admin.fedoraproject.org'; } - parent::__construct("http://$server/api/", $options); + parent::__construct("https://$server/pkgdb/api/", $options); $rep = $this->cache->get(__METHOD__, $this->url); if ($rep!==false) { @@ -109,21 +109,13 @@ class FedoraPkgdb extends FedoraClient function getPackageInfo($name, $refresh=false) { - if ($this->_version > 0) { - $url='package/acl/get/'.urlencode($name); - $rep = ($refresh ? false : $this->cache->get(__METHOD__, $this->url.$url)); - if ($rep) { - $this->logDebug(2, __METHOD__."($name) get from cache"); - } else { - $rep =$this->sendRequest($url); - $this->cache->save($rep, __METHOD__, $this->url.$url); - $this->logDebug(2, __METHOD__."($name) save to cache"); - } - $this->logDebug(8, print_r($rep, true)); - return false; - } - - $url='acls/name/'.urlencode($name); + static $convert=array( + 'master' => 'devel', + 'el5' => 'EL-5', + 'el6' => 'EL-6', + 'epel7' => 'EL-7', + ); + $url='package/'.urlencode($name); $rep = ($refresh ? false : $this->cache->get(__METHOD__, $this->url.$url)); if ($rep) { $this->logDebug(2, __METHOD__."($name) get from cache"); @@ -139,8 +131,18 @@ class FedoraPkgdb extends FedoraClient } $this->logDebug(8, print_r($rep, true)); $branches = array(); - foreach ($rep['packageListings'] as $pack) { - $branches[$pack['collection']['branchname']] = $pack; + foreach ($rep['packages'] as $pack) { + $n = $pack['collection']['branchname']; + if (isset($convert[$n])) $n=$convert[$n]; + + $pack['owner'] = $pack['point_of_contact']; + $pack['people'] = array(); + foreach ($pack['acls'] as $acl) { + if ($acl['acl']=='commit' && $acl['status']=='Approved') { + $pack['people'][] = $acl['fas_name']; + } + } + $branches[$n] = $pack; } $this->logDebug(7, print_r($branches, true)); return $branches; diff --git a/class/Parser.php b/class/Parser.php index 365f0f8..98fd997 100644 --- a/class/Parser.php +++ b/class/Parser.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableAcls.php b/class/TableAcls.php index 9ef71ae..570385d 100644 --- a/class/TableAcls.php +++ b/class/TableAcls.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableIterator.php b/class/TableIterator.php index 6cc85e9..831e845 100644 --- a/class/TableIterator.php +++ b/class/TableIterator.php @@ -4,7 +4,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -26,7 +26,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TablePearRepo.php b/class/TablePearRepo.php index 8554fe4..65ffeea 100644 --- a/class/TablePearRepo.php +++ b/class/TablePearRepo.php @@ -4,7 +4,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -26,7 +26,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableRRepo.php b/class/TableRRepo.php index 8d23082..226a796 100644 --- a/class/TableRRepo.php +++ b/class/TableRRepo.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableRpm.php b/class/TableRpm.php index 8a6b39b..12ac623 100644 --- a/class/TableRpm.php +++ b/class/TableRpm.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableRpmRepo.php b/class/TableRpmRepo.php index 3144abe..17e29d2 100644 --- a/class/TableRpmRepo.php +++ b/class/TableRpmRepo.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/class/TableUpstream.php b/class/TableUpstream.php index fbf7b98..e94d266 100644 --- a/class/TableUpstream.php +++ b/class/TableUpstream.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/fedcli.php b/fedcli.php index 0588caf..f0bd914 100755 --- a/fedcli.php +++ b/fedcli.php @@ -5,7 +5,7 @@ * * fedcli.php is a command line tools to test FedoraClient clmsses * - * Copyright (C) 2010-2013 Remi Collet + * Copyright (C) 2010-2014 Remi Collet * http://github.com/remicollet/rpmphp. * * Inspired from python-fedora @@ -132,12 +132,7 @@ function Package() { echo $branch.":\t".$pack['owner']; $i=0; - $tmp = array(); - foreach ($pack['people'] as $user) { - if (isset($user['aclOrder']['commit']['statuscode']) && $user['aclOrder']['commit']['statuscode']==3) { - $tmp[] = $user['username']; - } - } + $tmp = $pack['people']; if (count($tmp)) { sort($tmp); echo " (".implode($tmp, ', ').")\n"; diff --git a/include/config.php.dist b/include/config.php.dist index 8895cdc..9420631 100644 --- a/include/config.php.dist +++ b/include/config.php.dist @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/include/main.php b/include/main.php index e54f6f9..6e7e685 100644 --- a/include/main.php +++ b/include/main.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -28,7 +28,7 @@ * @package RPMPHP * * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/index.php b/index.php index 03412ef..5944d67 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/pkgdb-ajax.php b/pkgdb-ajax.php index 65c5724..da0ae1a 100644 --- a/pkgdb-ajax.php +++ b/pkgdb-ajax.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. @@ -63,16 +63,7 @@ if ( !isset($name) || !$name ) { unset($fedpkg[$k]['package']['id']); unset($fedpkg[$k]['package']['statuscode']); unset($fedpkg[$k]['package']['upstreamurl']); - $people = $fedpkg[$k]['people']; - $tmp = array(); - foreach ( $people as $p ) { - if (isset($p['aclOrder']['commit']['statuscode']) - && $p['aclOrder']['commit']['statuscode']==3) { - $tmp[] = $p['username']; - } - } - sort($tmp); - $fedpkg[$k]['people'] = implode($tmp, ', '); + $fedpkg[$k]['people'] = implode($fedpkg[$k]['people'], ', '); $fedpkg[$k]['package']['description'] = nl2br($fedpkg[$k]['package']['description']); } } diff --git a/refresh.php b/refresh.php index 6d934c5..cf69818 100644 --- a/refresh.php +++ b/refresh.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/rpm.php b/rpm.php index 7ddcb77..b456554 100644 --- a/rpm.php +++ b/rpm.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. diff --git a/zoom.php b/zoom.php index 9f26f27..0f2b537 100644 --- a/zoom.php +++ b/zoom.php @@ -7,7 +7,7 @@ * * PHP version 5 * - * Copyright © 2010 Remi Collet + * Copyright © 2010-2014 Remi Collet * * This file is part of rpmphp. * @@ -29,7 +29,7 @@ * * @author Remi Collet * @author Johan Cwiklinski - * @copyright 2010 Remi Collet + * @copyright 2010-2014 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. @@ -76,16 +76,7 @@ function getBranchPeople($params) } } if ( $people == 'people' && is_array($ret_tmp)) { - $tmp = array(); - foreach ( $ret_tmp as $r ) { - if (isset($r['aclOrder']['commit']['statuscode']) - && $r['aclOrder']['commit']['statuscode']==3 - ) { - $tmp[] = $r['username']; - } - } - sort($tmp); - $ret = implode($tmp, ', '); + $ret = implode($ret_tmp, ', '); } return $ret; } -- cgit