diff options
Diffstat (limited to 'Report/Box/02_SourcePackage.php')
-rw-r--r-- | Report/Box/02_SourcePackage.php | 69 |
1 files changed, 69 insertions, 0 deletions
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 @@ +<?php +/** + * Source packages reporting box. + * + * PHP version 5 + * + * @category Dashboard + * @package Buildsystem + * @author Romain d'Alverny <rda@mageia.org> + * @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 <a href="http://svn.mageia.org/">svn</a>, <a href="http://check.mageia.org/updates.html">youri-check report</a>'; + } + + /** + * 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, + ); + } + +} |