/[soft]/build_system/web/maintainers.php
ViewVC logotype

Contents of /build_system/web/maintainers.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6186 - (show annotations) (download)
Wed Oct 10 11:11:21 2012 UTC (11 years, 6 months ago) by rda
File size: 4013 byte(s)
show/list unmaintained packages & biggest maintainers
1 <?php
2 /**
3 * Mageia build-system quick status report script.
4 * Show how maintainership is distributed among packagers.
5 *
6 * TODO(rda) show the capacity of all packagers?
7 *
8 * @copyright Copyright (C) 2012 Mageia.Org
9 *
10 * @author Romain d'Alverny
11 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU GPL v2
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License aspublished by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
17 */
18
19 $data = file('data/maintdb.txt');
20
21 $maintainers = array();
22
23 foreach ($data as $line) {
24 $line = explode(" ", $line);
25 $p = trim($line[0]);
26 $m = trim($line[1]);
27
28 $maintainers[$m] += 1;
29 }
30 arsort($maintainers);
31
32 $half = 0;
33 $pkgCount = 0;
34
35 $stats = array(
36 'packagers' => count($maintainers) - 1,
37 'packages' => count($data),
38 'unmaintained' => $maintainers['nobody']
39 );
40
41 foreach ($maintainers as $name => $count) {
42 if ($name == 'nobody')
43 continue;
44
45 $pkgCount += $count;
46 $pkgr += 1;
47 if ($pkgCount > $stats['packages'] * 0.50)
48 break;
49 }
50
51 $stats['half_maintainers'] = $pkgr;
52
53 ?>
54 <html>
55 <head>
56 <style>
57 body { font-family: Georgia; }
58 .pkgrs { margin: 0; padding: 0; }
59 li.pkgr { margin: 0 1em 0.8em 1em; list-style-position: inside; padding: 0.5em; width: 300px; }
60 .uid { font-weight: bold; font-family: Verdana; }
61 .pkg-count, .pkg-more { font-size: 90%; color: #888; display: block; }
62 .pkgr-nobody { background: lightyellow; }
63 .figure { font-weight: bold; font-size: 120%; }
64 </style>
65 </head>
66 <body>
67
68 <h1>Mageia packaging facts</h1>
69 <ul>
70 <li><span class="figure"><?php echo number_format($stats['packages'])?></span> packages
71 <ul>
72 <li><span class="figure"><?php echo $stats['unmaintained']?></span> have no maintainer</li>
73 </ul></li>
74 <li><span class="figure"><?php echo $stats['packagers']?></span> packagers
75 <ul>
76 <li><span class="figure"><?php echo $stats['half_maintainers']?></span> maintain more than 50% of all packages.</li>
77 <li>they are: <?php
78 echo implode(
79 ', ',
80 array_map(
81 function ($value, $key) {
82 if ($key == 'nobody')
83 return null;
84
85 return $key . ' (' . $value . ')';
86 },
87 array_slice($maintainers, 0, $stats['half_maintainers']+1),
88 array_slice(array_keys($maintainers), 0, $stats['half_maintainers']+1)
89 )
90 ); ?></li>
91 </ul></li>
92 </ul>
93 <div id="maintainers"></div>
94 <div id="chart_div" style="width: 900px; height: 500px;"></div>
95 <?php
96
97 $rows = array();
98 foreach ($maintainers as $name => $count) {
99 $rows[] = sprintf("['%s', 'Global', %d]", $name, $count);
100 }
101 $rows = implode(",\n", $rows);
102 ?>
103 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
104 <script type="text/javascript">
105
106 // Load the Visualization API and the piechart package.
107 //google.load('visualization', '1.0', {'packages':['corechart']});
108 google.load("visualization", "1", {packages:["treemap"]});
109
110 function drawChart3() {
111 // Create and populate the data table.
112 var data = google.visualization.arrayToDataTable([
113 ['Location', 'Parent', 'Count'],
114 ['Global', null, 0],
115 <?php echo $rows;?>
116 ]);
117
118 // Create and draw the visualization.
119 var tree = new google.visualization.TreeMap(document.getElementById('chart_div'));
120 tree.draw(data, {
121 /*
122 minColor: '#f00',
123 midColor: '#ddd',
124 maxColor: '#0d0',
125 */
126 headerHeight: 15,
127 fontColor: 'black',
128 showScale: true});
129 }
130 // Set a callback to run when the Google Visualization API is loaded.
131 google.setOnLoadCallback(drawChart3);
132
133 </script>
134 </body>
135 </html>

  ViewVC Help
Powered by ViewVC 1.1.30