diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-10-10 11:11:21 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-10-10 11:11:21 +0000 |
commit | 4a9cd1138228dd06eb280d232a4b450221866f98 (patch) | |
tree | 1930283c7c27fa12bca29b96e017a10dda80af72 | |
parent | cc866414aca2f9efce36ef16b17f5595ed33a741 (diff) | |
download | pkgsubmit-4a9cd1138228dd06eb280d232a4b450221866f98.tar pkgsubmit-4a9cd1138228dd06eb280d232a4b450221866f98.tar.gz pkgsubmit-4a9cd1138228dd06eb280d232a4b450221866f98.tar.bz2 pkgsubmit-4a9cd1138228dd06eb280d232a4b450221866f98.tar.xz pkgsubmit-4a9cd1138228dd06eb280d232a4b450221866f98.zip |
show/list unmaintained packages & biggest maintainers
-rw-r--r-- | maintainers.php | 135 | ||||
-rw-r--r-- | unmaintained.php | 61 |
2 files changed, 196 insertions, 0 deletions
diff --git a/maintainers.php b/maintainers.php new file mode 100644 index 0000000..77b43c5 --- /dev/null +++ b/maintainers.php @@ -0,0 +1,135 @@ +<?php +/** + * Mageia build-system quick status report script. + * Show how maintainership is distributed among packagers. + * + * TODO(rda) show the capacity of all packagers? + * + * @copyright Copyright (C) 2012 Mageia.Org + * + * @author Romain d'Alverny + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License aspublished by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. +*/ + +$data = file('data/maintdb.txt'); + +$maintainers = array(); + +foreach ($data as $line) { + $line = explode(" ", $line); + $p = trim($line[0]); + $m = trim($line[1]); + + $maintainers[$m] += 1; +} +arsort($maintainers); + +$half = 0; +$pkgCount = 0; + +$stats = array( + 'packagers' => count($maintainers) - 1, + 'packages' => count($data), + 'unmaintained' => $maintainers['nobody'] +); + +foreach ($maintainers as $name => $count) { + if ($name == 'nobody') + continue; + + $pkgCount += $count; + $pkgr += 1; + if ($pkgCount > $stats['packages'] * 0.50) + break; +} + +$stats['half_maintainers'] = $pkgr; + +?> +<html> +<head> + <style> + body { font-family: Georgia; } + .pkgrs { margin: 0; padding: 0; } + li.pkgr { margin: 0 1em 0.8em 1em; list-style-position: inside; padding: 0.5em; width: 300px; } + .uid { font-weight: bold; font-family: Verdana; } + .pkg-count, .pkg-more { font-size: 90%; color: #888; display: block; } + .pkgr-nobody { background: lightyellow; } + .figure { font-weight: bold; font-size: 120%; } + </style> +</head> +<body> + + <h1>Mageia packaging facts</h1> + <ul> + <li><span class="figure"><?php echo number_format($stats['packages'])?></span> packages + <ul> + <li><span class="figure"><?php echo $stats['unmaintained']?></span> have no maintainer</li> + </ul></li> + <li><span class="figure"><?php echo $stats['packagers']?></span> packagers + <ul> + <li><span class="figure"><?php echo $stats['half_maintainers']?></span> maintain more than 50% of all packages.</li> + <li>they are: <?php +echo implode( + ', ', + array_map( + function ($value, $key) { + if ($key == 'nobody') + return null; + + return $key . ' (' . $value . ')'; + }, + array_slice($maintainers, 0, $stats['half_maintainers']+1), + array_slice(array_keys($maintainers), 0, $stats['half_maintainers']+1) + ) +); ?></li> + </ul></li> + </ul> + <div id="maintainers"></div> + <div id="chart_div" style="width: 900px; height: 500px;"></div> + <?php + +$rows = array(); +foreach ($maintainers as $name => $count) { + $rows[] = sprintf("['%s', 'Global', %d]", $name, $count); +} +$rows = implode(",\n", $rows); +?> + <script type="text/javascript" src="https://www.google.com/jsapi"></script> + <script type="text/javascript"> + + // Load the Visualization API and the piechart package. + //google.load('visualization', '1.0', {'packages':['corechart']}); + google.load("visualization", "1", {packages:["treemap"]}); + + function drawChart3() { + // Create and populate the data table. + var data = google.visualization.arrayToDataTable([ + ['Location', 'Parent', 'Count'], + ['Global', null, 0], + <?php echo $rows;?> + ]); + + // Create and draw the visualization. + var tree = new google.visualization.TreeMap(document.getElementById('chart_div')); + tree.draw(data, { + /* + minColor: '#f00', + midColor: '#ddd', + maxColor: '#0d0', + */ + headerHeight: 15, + fontColor: 'black', + showScale: true}); + } + // Set a callback to run when the Google Visualization API is loaded. + google.setOnLoadCallback(drawChart3); + + </script> +</body> +</html>
\ No newline at end of file diff --git a/unmaintained.php b/unmaintained.php new file mode 100644 index 0000000..2e7d73a --- /dev/null +++ b/unmaintained.php @@ -0,0 +1,61 @@ +<?php +/** + * Mageia build-system quick status report script. + * List unmaintained packages, with a twist. + * + * @copyright Copyright (C) 2012 Mageia.Org + * + * @author Romain d'Alverny + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License aspublished by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. +*/ + +$data = file('data/unmaintained.txt'); +//$data = array_slice($data, 0, 10); + +$groups = array(); + +foreach ($data as $package) { + $package = trim($package); + if (substr($package, 0, 8) == 'libgnome') { + $groups['gnome'][] = $package; + } elseif (substr($package, 0, 3) == 'lib') { + $p = substr($package, 3); + $groups[$p][] = $package; + } else { + $p = explode('-', $package); + if (count($p) > 1) { + $groups[$p[0]][] = $package; + } else { + $groups[$package][] = $package; + } + } +} + +$s = count($groups) . ' groups for ' . count($data) . ' packages.'; +$s .= '<ul class="groups">'; + +$s .= array_reduce($groups, function ($res, $el) { + return $res . '<li>' . implode(', ', array_map(function ($ela) { + $spec_url = sprintf('http://svnweb.mageia.org/packages/cauldron/%s/current/SPECS/%s.spec?view=markup', $ela, $ela); + return sprintf('<a href="%s">%s</a>', $spec_url, $ela); + }, $el)) . '</li>'; +}); +$s .= '</<ul>'; + +echo <<<S +<style> +ul.groups { list-style: none; margin: 0; padding: 0; } + ul.groups li { display: inline-block; padding: 1em; background: #eee; margin: 1px; font-family: Verdana; font-size: 70%; } +</style> + +<h1>Unmaintained packages</h1> +<p>Pick one and become a Mageia packager super-hero! (TODO how? why?)</p> +<p>A group means that you may want to pick all packages within the same group, for consistency and efficiency.</p> +<p>Don't hesitate to ask on #mageia-dev, and to notify if you take maintenance of one package.</p> +$s +S; |