- ';
$figures_list = array();
if (!isset($_GET['package'])) {
// TODO should be cached.
$missing_deps_count = preg_match_all("/
- /m", file_get_contents("http://check.mageia.org/cauldron/dependencies.rss"), $matches);
$unmaintained_count = file_exists(__DIR__ . '/data/unmaintained.txt') ? count(file(__DIR__ . '/data/unmaintained.txt')) : 0;
if ($missing_deps_count > 0
|| $unmaintained_count > 0
) {
if ($missing_deps_count > 0) {
$figures_list[] = sprintf('%d broken dependencies',
$missing_deps_count,
'http://check.mageia.org/cauldron/dependencies.html'
);
}
if ($unmaintained_count > 0) {
$figures_list[] = sprintf('%d unmaintained package%s',
$unmaintained_count,
'data/unmaintained.txt',
plural($unmaintained_count)
);
}
if (count($figures_list) > 0)
$figures_list[count($figures_list)-1] .= sprintf(' » %s',
'https://wiki.mageia.org/en/Importing_packages',
'you can help!');
}
preg_match_all('/(\d+)/', file_get_contents("https://bugs.mageia.org/buglist.cgi?quicksearch=%40qa-bugs+-kw%3Avali"), $matches);
$qa_bugs = $matches[1][0];
if ($qa_bugs > 0) {
$figures_list[] = sprintf('%d package update%s to validate » %s',
$qa_bugs,
'https://bugs.mageia.org/buglist.cgi?quicksearch=%40qa-bugs+-kw%3Avali',
plural($qa_bugs),
'https://wiki.mageia.org/en/QA_process_for_validating_updates',
'you can help!'
);
}
if (count($figures_list) > 0) {
echo array_reduce($figures_list, function ($res, $e) { return $res . '
'; }, ''); } $buildtime_stats = array(); // Builds in progress if (count($hosts) > 0) { echo '' . $e . '
- ', sprintf('
'; } else { //echo '%d build%s in progress:
', count($hosts), plural(count($hosts))); $s = ''; $tmpl = <<%s %s %s %s/%s %s %s TB; foreach ($hosts as $machine => $b) { foreach ($b as $arch => $key) { $s .= sprintf($tmpl, $pkgs[$key]['package'], $pkgs[$key]['user'], $pkgs[$key]['user'], $pkgs[$key]['version'], $pkgs[$key]['media'], $pkgs[$key]['section'], $machine, $arch); } } echo '', '', '', ' ', $s, 'Package User Target media Machine arch '; } } $upload_time = get_upload_time(); if (!is_null($upload_time)) { echo sprintf('No build in progress.
', timediff($upload_time)); } // Build queue $s = ''; $tmpl = <<Upload in progress for %s.
%s view changes @ r%d %s %s %s %s/%s T; if ($total > 0) { foreach ($pkgs as $key => $p) { if (trim($p['package']) == '') { continue; } $revision_link = sprintf('http://svnweb.mageia.org/packages?view=revision&revision=%d', $p['revision']); $s .= sprintf($tmpl, $p['type'], $revision_link, addslashes($p['summary']), $p['package'], $revision_link, $p['revision'], $p['user'], $p['user'], timediff(key2timestamp($key)) . ' ago', $p['version'], $p['media'], $p['section'] ); $typelink = ''; if ($p['type'] == 'failure') { $typelink = '/uploads/' . $p['type'] . '/' . $p['path']; } elseif ($p['type'] == 'rejected') { $typelink = '/uploads/' . $p['type'] . '/' . $p['path'] . '.youri'; } else { $typelink = '/uploads/done/' . $p['path']; if (!is_dir(realpath($upload_dir . '/..' . $typelink))) { $typelink = ''; } } $typestr = $p['type']; if (isset($p['status']['build'])) { $typealt = 'Building on'; foreach ($p['status']['build'] as $h) { $typealt .= " $h"; } $typestr = "$typestr"; } $s .= ' '; $show_time = ''; if ($p['type'] == 'uploaded') { $tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); // use $p['buildtime']['diff']; instead? $show_time = '' . $tdiff . ''; $tdiff = floor(($p['buildtime']['end'] - $p['buildtime']['start']) / 60)*60; @$buildtime_stats[timediff(0, $tdiff)] += 1; } $s .= ($typelink != '') ? sprintf(' %s %s', $typelink, $typestr, $show_time) : sprintf(' %s %s', $typestr, $show_time); $s .= ' '; } echo sprintf('%d packages submitted in the past %d hours:
', $total, $max_modified * 24); // Last submitted packages echo '', '
'; // Stats $s = 'Package Who when Target media Status build time '; $total_buildtime = round($buildtime_total / 60, 1); $avail_capacity = 24 * $max_modified * $g_nodes_count; $capacity_used = round($total_buildtime / $avail_capacity * 100, 1); $s .= sprintf( ''; echo $s, 'Total time %s hours (%s%% of capacity with %d nodes) Average %s minutes Builds count %s
No package has been submitted in the past %d hours.
Generated at . Code for this page is in http://svnweb.mageia.org/soft/build_system/web/.