From 6044757ccad1de77294dc429608553fcce9e0250 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 4 Sep 2012 10:34:10 +0000 Subject: regroup bs info in a list --- test_index.php | 112 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 40 deletions(-) diff --git a/test_index.php b/test_index.php index 38daf75..0afc0ce 100644 --- a/test_index.php +++ b/test_index.php @@ -215,38 +215,67 @@ if (!is_null($g_user) || $_GET['package']) { echo '« Back to full list'; } +$figures_list = array(); + if (!$_GET['package']) { + $missing_deps_count = preg_match_all("//m", file_get_contents("http://check.mageia.org/cauldron/dependencies.rss"), $matches); $unmaintained_count = count(file(__DIR__ . '/data/unmaintained.txt')); - if ($missing_deps_count > 0 || $unmaintained_count > 0) { - echo "

"; + + if ($missing_deps_count > 0 + || $unmaintained_count > 0 + ) { if ($missing_deps_count > 0) { - echo "$missing_deps_count broken dependencies. "; + $figures_list[] = sprintf('%d broken dependencies', + $missing_deps_count, + 'http://check.mageia.org/cauldron/dependencies.html' + ); } if ($unmaintained_count > 0) { - echo "$unmaintained_count unmaintained packages. "; + $figures_list[] = sprintf('%d unmaintained package%s', + $unmaintained_count, + 'data/unmaintained.txt', + plural($unmaintained_count) + ); } - echo '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) { - echo "

"; - echo "$qa_bugs package updates to validate. "; - echo 'You can help!

'; -} + if (count($figures_list) > 0) + $figures_list[count($figures_list)-1] .= sprintf(' » %s', + 'https://wiki.mageia.org/en/Importing_packages', + 'you can help!'); + } -if ($upload_time) { - echo sprintf('

Upload in progress for %s.

', timediff($upload_time)); -} + 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!' + ); + } -$buildtime_stats = array(); + if ($upload_time) { + $figures_list[] = sprintf('

Upload in progress for %s.

', timediff($upload_time)); + } -// Builds in progress -$s = ''; -$tmpl = << 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 @@ -256,25 +285,27 @@ $tmpl = <<%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']); + 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 '
    ', + '', + $s, + '
    MachineArchUserPackageTargetMedia
    ', + '
    ', + '
  • '; + } else { + echo '
  • No build in progress.

  • '; } } -echo '
    ', - sprintf('', count($hosts), plural(count($hosts))), - '', - $s, - '
    %d build%c in progress.
    MachineArchUserPackageTargetMedia
    '; -echo '
    '; - -} // Build queue $s = ''; @@ -337,9 +368,9 @@ if ($total > 0) { $s .= ''; $s .= ''; } + echo sprintf('
  • %d packages submitted in the past %d hours.

    ', $total, $max_modified * 24); // Table echo '', - '', '', @@ -406,15 +437,16 @@ if ($total > 0) { $s .= '
    ', $total, ' packages submitted in the past ', $max_modified * 24, ' hours.
    SubmittedUser PackageTargetMedia StatusBuild time
    '; $s .= ''; - echo $s; + echo $s, '
  • '; } else { - echo sprintf('

    No package has been submitted in the past %d hours.

    ', + echo sprintf('
  • No package has been submitted in the past %d hours.

  • ', $max_modified * 24); } ?> +

Generated at . -- cgit v1.2.1