aboutsummaryrefslogtreecommitdiffstats
path: root/Report/Box/04_CauldronPackages.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-05-04 13:26:54 +0000
committerRomain d'Alverny <rda@mageia.org>2011-05-04 13:26:54 +0000
commitd08c07b68d0e88d863f597fe5e9ed72d84229ab7 (patch)
tree30b86dbcb4af35e87f2a76c637a214583022a0db /Report/Box/04_CauldronPackages.php
parent25cbfbccf63d176683a3da50913679cab311e21c (diff)
downloaddashboard-d08c07b68d0e88d863f597fe5e9ed72d84229ab7.tar
dashboard-d08c07b68d0e88d863f597fe5e9ed72d84229ab7.tar.gz
dashboard-d08c07b68d0e88d863f597fe5e9ed72d84229ab7.tar.bz2
dashboard-d08c07b68d0e88d863f597fe5e9ed72d84229ab7.tar.xz
dashboard-d08c07b68d0e88d863f597fe5e9ed72d84229ab7.zip
initial import
Diffstat (limited to 'Report/Box/04_CauldronPackages.php')
-rw-r--r--Report/Box/04_CauldronPackages.php146
1 files changed, 146 insertions, 0 deletions
diff --git a/Report/Box/04_CauldronPackages.php b/Report/Box/04_CauldronPackages.php
new file mode 100644
index 0000000..c275f94
--- /dev/null
+++ b/Report/Box/04_CauldronPackages.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * Cauldron 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_CauldronPackages extends Report_Box
+{
+ /**
+ */
+ var $title = "Cauldron Compiled Packages";
+
+ /**
+ */
+ function _get_var_definitions() {
+ return array(
+ 'size' => '%5.1fGB',
+ 'count-i586-rpms' => '%d packages (i586)',
+ 'count-x86_64-rpms' => '%d packages (x86_64)',
+ 'broken-pkgs' => array('l' => '%d have broken dependencies', 't' => '<=0'),
+ 'obs-bin' => array('l' => '%d obsolete binaries', 't' => '<=0'),
+ 'obs-source' => array('l' => '%d obsolete sources', 't' => '<=0'),
+ 'mis-source' => array('l' => '%d missing sources', 't' => '<=0'),
+ 'missing-deps' => array('l' => '%d missing dependencies', 't' => '<=0')
+ );
+ /*
+ ?GB
+ ? packages
+ Broken hdlist (i586/nonfree)
+ Signatures: 23 missing (i586/nonfree, i586/tainted)
+ Dependencies: 32 missing, 2 circular
+ 15 packages are not in sync with their source
+ 432 missing/broken signatures
+ 213 bugs
+ @todo: per package test suite? rpmlint, other
+ @todo: src => 32/64/arm
+ Basesystem size: 437MB, w/o suggests: 163MB
+ view repository, detailed report
+
+ */
+ }
+
+ /**
+ */
+ function _get_links()
+ {
+ return 'View <a href="http://check.mageia.org/">youri-check report</a>';
+ }
+
+
+ /**
+ * Uses youri-check report.
+ */
+ function _fetch_03_missing_dependencies()
+ {
+ $txt = file('http://check.mageia.org/missing.txt');
+ array_shift($txt);
+ array_shift($txt);
+ array_shift($txt);
+
+ $ret = array(
+ 'obs-source' => 0,
+ 'obs-bin' => 0,
+ 'mis-source' => 0
+ );
+ foreach ($txt as $l)
+ {
+ $l = explode("\t", $l);
+ if (!isset($l[3]) || !isset($l[5]))
+ continue;
+
+ $arch = trim($l[3]);
+ $reason = substr(trim($l[5]), 0, 14);
+ if ($arch == 'src') { //&& $l[5], 'Obsolete source')) {
+ $ret['obs-source'] += 1;
+ } elseif ($reason == 'Missing source') {
+ $ret['mis-source'] += 1;
+ } elseif ($reason == 'Obsolete binar') {
+ $ret['obs-bin'] += 1;
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * Uses youri-check report.
+ */
+ function _fetch_02_broken_dependencies()
+ {
+ $txt = file('http://check.mageia.org/dependencies.txt');
+ array_shift($txt);
+ array_shift($txt);
+ array_shift($txt);
+
+ $package = null;
+
+ $reports = array();
+ foreach ($txt as $l)
+ {
+ $l = explode("\t", $l);
+ if (isset($l[0]) && isset($l[4])) {
+ $packages[] = trim($l[0]);
+ $missing[] = trim($l[4]);
+ }
+ }
+
+ $packages = array_unique($packages);
+ sort($packages);
+ $missing = array_unique($missing);
+ sort($missing);
+
+ return array(
+ 'broken-pkgs' => count($packages) - 1,
+ 'missing-deps' => count($missing) - 1
+ );
+ }
+
+ /**
+ * Uses sophie.zarb.org
+ */
+ function _fetch_01_packages()
+ {
+ $count_i586 = substr_count(
+ file_get_contents('http://sophie.zarb.org/distrib/Mageia/cauldron/i586/rpms?json=1'),
+ 'pkgid'
+ );
+ $count_x86_64 = substr_count(
+ file_get_contents('http://sophie.zarb.org/distrib/Mageia/cauldron/x86_64/rpms?json=1'),
+ 'pkgid'
+ );
+
+ return array(
+ 'count-i586-rpms' => $count_i586,
+ 'count-x86_64-rpms' => $count_x86_64
+ );
+ }
+}