array(),
'path' => $val[2],
'version' => $val[3],
'media' => $val[4],
'section' => $val[5],
'user' => $val[7],
'host' => $val[8],
'job' => $val[9]
);
}
$status = $val[1];
$data = $val[10];
if (preg_match("/@(\d+):/", $data, $revision)) {
$pkgs[$key]['revision'] = $revision[1];
}
$pkgs[$key]['status'][$status] = 1;
$ext = $val[11];
if ($ext == '.src.rpm.info') {
preg_match("!^(?:@\d+:)?(.*)!", $data, $name);
$pkgs[$key]['package'] = $name[1];
} else if ($ext == '.src.rpm') {
$pkgs[$key]['status']['src'] = 1;
} else if ($ext == '.upload') {
$pkgs[$key]['status']['upload'] = 1;
} else if ($ext == '.lock') {
preg_match("!(.*)\.iurt\.(.*)\.\d+\.\d+!", $data, $buildhost);
if (!$hosts[$buildhost[2]]) {
$hosts[$buildhost[2]]= array();
}
$hosts[$buildhost[2]][$buildhost[1]] = $key;
if ($pkgs[$key]['status']['build']) {
array_push($pkgs[$key]['status']['build'], $buildhost[2]);
} else {
$pkgs[$key]['status']['build'] = array($buildhost[2]);
}
} else if ($ext == '.done') {
// beware! this block is called twice for a given $key
$pkgs[$key]['buildtime']['start'] = key2timestamp($val[6]);
$pkgs[$key]['buildtime']['end'] = round($val[12]);
$pkgs[$key]['buildtime']['diff'] = $pkgs[$key]['buildtime']['end'] - $pkgs[$key]['buildtime']['start'];
@$build_dates[date('H', $pkgs[$key]['buildtime']['start'])] += 1;
// keep obviously dubious values out of there
// 12 hours is be an acceptable threshold given current BS global perfs
// as of April 2011
if ($pkgs[$key]['buildtime']['diff'] < 43200) {
$buildtime_total[$key] = $pkgs[$key]['buildtime']['diff'];
}
}
}
// filter packages if a package name was provided
if (isset($_GET['package'])) {
foreach ($pkgs as $key => $pkg) {
preg_match("/^(.*)-[^-]*-[^-]*$/", $pkg['package'], $name);
if ($_GET['package'] != $name[1]) {
unset($pkgs[$key]);
}
}
}
// sort by key in reverse order to have more recent pkgs first
krsort($pkgs);
ksort($build_dates);
$build_count = count($buildtime_total);
$buildtime_total = array_sum($buildtime_total);
// above block. OUTPUT: $pkgs, $build_dates, $buildtime_total, $hosts
list($stats, $users, $total, $pkgs) = build_stats($pkgs);
$last_pkg = (isset($_GET['last']) && $total > 0) ? reset($pkgs) : null;
publish_stats_headers($stats, $buildtime_total, $build_count, $last_pkg);
?>
« Back to full list';
}
echo '';
$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 . '
' . $e . '
'; }, '');
}
$buildtime_stats = array();
// Builds in progress
if (count($hosts) > 0) {
echo '- ',
sprintf('
%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,
$machine,
$arch,
$pkgs[$key]['user'], $pkgs[$key]['user'],
$pkgs[$key]['package'],
$pkgs[$key]['version'],
$pkgs[$key]['media'], $pkgs[$key]['section']);
}
}
echo '',
'Machine | Arch | User | Package | Target | Media |
',
$s,
'
',
'',
' ';
} else {
echo 'No build in progress.
';
}
}
$upload_time = get_upload_time();
if (!is_null($upload_time)) {
echo sprintf('Upload in progress for %s.
', timediff($upload_time));
}
// Build queue
$s = '';
$tmpl = <<
%s |
%s |
%s |
%s |
%s/%s |
|
T;
if ($total > 0) {
foreach ($pkgs as $key => $p) {
if (trim($p['package']) == '') {
continue;
}
$s .= sprintf($tmpl,
$p['type'],
timediff(key2timestamp($key)) . ' ago',
$p['user'], $p['user'],
$p['revision'],
addslashes($p['summary']),
$p['package'],
$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("..$typelink")) {
$typelink = '';
}
}
$typestr = $p['type'];
if ($p['status']['build']) {
$typealt = 'Building on';
foreach ($p['status']['build'] as $h) {
$typealt .= " $h";
}
$typestr = "$typestr";
}
$s .= '';
$s .= ($typelink != '') ?
sprintf('%s', $typelink, $typestr) :
$typestr;
$s .= ' | ';
if ($p['type'] == 'uploaded') {
$tdiff = timediff($p['buildtime']['start'], $p['buildtime']['end']); // use $p['buildtime']['diff']; instead?
$s .= $tdiff;
$tdiff = floor(($p['buildtime']['end'] - $p['buildtime']['start']) / 60)*60;
@$buildtime_stats[timediff(0, $tdiff)] += 1;
}
$s .= ' | ';
$s .= '';
}
echo sprintf('%d packages submitted in the past %d hours:
', $total, $max_modified * 24);
// Table
echo '',
'Submitted | User |
Package | Target | Media |
Status | Build time |
',
'', $s, '',
'
';
// Stats
$s = '
';
$s .= sprintf('
Total time | %s hours |
Average | %s minutes |
Builds count | %s |
',
round($buildtime_total / 60, 2),
$buildtime_avg,
$buildtime_cnt);
$s .= '
';
$s .= '
';
$s .= '
';
echo $s, ' ';
}
else
{
echo sprintf('No package has been submitted in the past %d hours.
',
$max_modified * 24);
}
?>
',
mga_bs_charts::js_draw_status_chart($stats, 'status-chart'),
mga_bs_charts::js_draw_buildtime_chart($buildtime_stats, 'buildtime-chart'),
mga_bs_charts::js_draw_buildschedule_chart($build_dates, 'buildschedule-chart'),
mga_bs_charts::js_draw_packagers_chart($users, 'packagers-chart'),
mga_bs_charts::js_draw_charts(),
'';
echo mga_bs_charts::js_init();
?>
Generated at .
Code for this page is in http://svnweb.mageia.org/soft/build_system/web/.