From d08c07b68d0e88d863f597fe5e9ed72d84229ab7 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 4 May 2011 13:26:54 +0000 Subject: initial import --- Report/Box/02_SourcePackage.php | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Report/Box/02_SourcePackage.php (limited to 'Report/Box/02_SourcePackage.php') diff --git a/Report/Box/02_SourcePackage.php b/Report/Box/02_SourcePackage.php new file mode 100644 index 0000000..9ba0039 --- /dev/null +++ b/Report/Box/02_SourcePackage.php @@ -0,0 +1,69 @@ + + * @license MIT License, see LICENSE.txt + * @link http://svnweb.mageia.org/svn/soft/dashboard/ +*/ + +/** +*/ +class Report_Box_SourcePackage extends Report_Box +{ + /** + */ + var $title = "Source packages"; + + /** + */ + function _get_var_definitions() { + return array( + 'size' => '%5.1fGB', + 'count-srpms' => '%d packages', + 'upstream-updates' => array('l' => '%d have an update', 't' => '==0'), + 'orphans' => array('l' => '%d orphans', 't' => '>0'), + 'patches' => '%d patches', + 'bugs' => array('l' => '%d open bugs', 't' => '>0'), + 'rpmlint' => array('l' => '%d rpmlint errors', 't' => '>0'), + ); + } + + /** + */ + function _get_links() + { + return 'View svn, youri-check report'; + } + + /** + * Uses youri-check updates report (check.mageia.org) + */ + function _fetch_upstream_updates() + { + $txt = file('http://check.mageia.org/updates.txt'); + return array( + 'upstream-updates'=> count($txt) - 5 + ); + } + + /** + * Uses sophie.zarb.org + */ + function _fetch_source_packages() + { + $count = substr_count( + file_get_contents('http://sophie.zarb.org/distrib/Mageia/cauldron/i586/srpms?json=1'), + 'pkgid' + ); + + return array( + 'count-srpms' => $count, + ); + } + +} -- cgit v1.2.1