From b1ab0e6891f5ff0db6140a0846eb7d4c9af69f42 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 16 Dec 2020 16:52:32 +0100 Subject: avoid warnings, pkgdb is dead --- class/FedoraPkgdb.php | 2 ++ pkgdb-ajax.php | 4 ++-- zoom.php | 15 ++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/class/FedoraPkgdb.php b/class/FedoraPkgdb.php index 3030a61..3fb292d 100644 --- a/class/FedoraPkgdb.php +++ b/class/FedoraPkgdb.php @@ -109,6 +109,8 @@ class FedoraPkgdb extends FedoraClient function getPackageInfo($name, $refresh=false) { + return false; + static $convert=array( 'master' => 'devel', 'el5' => 'EL-5', diff --git a/pkgdb-ajax.php b/pkgdb-ajax.php index 82eb5b7..cddaea5 100644 --- a/pkgdb-ajax.php +++ b/pkgdb-ajax.php @@ -44,7 +44,7 @@ if ( !isset($name) || !$name ) { $fedcli = new FedoraPkgdb(); $fedpkg = $fedcli->getPackageInfo($name); if ( $fedpkg === false ) { - $fedpkg = array('error' => 'Unknown package'); + $fedpkg = array(/*'error' => 'Unknown package'*/); } else { //let's clean all little to avoid heavy json foreach ( array_keys($fedpkg) as $k ) { @@ -69,4 +69,4 @@ if ( !isset($name) || !$name ) { } } echo json_encode($fedpkg); -?> \ No newline at end of file +?> diff --git a/zoom.php b/zoom.php index e9ec55c..d843ea5 100644 --- a/zoom.php +++ b/zoom.php @@ -131,7 +131,7 @@ if ( !isset($name) || !$name ) { $summary['Description'] = ( (isset($fedpkg['devel']['package']['description'])) ? $fedpkg['devel']['package']['description'] : - $ajax_infos + ($ajax_infos ?? '') ); if ( $rpm->url ) { $summary['URL'] = $rpm->url; @@ -169,11 +169,11 @@ if ( !isset($name) || !$name ) { $summary['Fedora git'] = "https://src.fedoraproject.org/cgit/rpms/$name.git/"; $summary['Packages'] = "https://apps.fedoraproject.org/packages/$name"; - if (isset($_GET['pkgdb'])) { - $fedpkg = $fedcli->getPackageInfo($name); - } else { + //if (isset($_GET['pkgdb'])) { + // $fedpkg = $fedcli->getPackageInfo($name); + //} else { $fedpkg = false; - } + //} $i=0; $prev=false; @@ -182,12 +182,14 @@ if ( !isset($name) || !$name ) { $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; } + */ $packages[] = $rpm; if ( $rpm->repo_main != $prev ) { $prev = $rpm->repo_main; @@ -212,10 +214,13 @@ $ariane[] = array( 'url' => '#', 'text' => 'Package: ' . $name ); +/* $ajax_infos = '(wait for ajax or reload with pkgdb)'; $smarty->assign('ajax_infos', $ajax_infos); +*/ +$smarty->assign('ajax_infos', ''); $smarty->assign('ariane', $ariane); $smarty->assign('page_title', 'Package: ' . $name); -- cgit