From 4a2d4ab0999b888141e67e54786b51552517600f Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 20 Feb 2012 23:06:24 +0000 Subject: Use youri-check results to count the number of broken dependencies --- index.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index cb753c2..b7a1f69 100644 --- a/index.php +++ b/index.php @@ -113,12 +113,6 @@ if ($g_user) { $tz = new DateTimeZone('UTC'); $date_gen = date('c'); -# Temporary until initial mirror is ready -chdir("data"); -$missing_deps = file("missing-deps.i586.txt"); -######################################### -$unmaintained = file('unmaintained.txt'); - chdir($upload_dir); $all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.lock' -o -name '*.done' -o -name '*.upload' \) -ctime -$max_modified -printf \"%p\t%T@\\n\""); @@ -327,15 +321,16 @@ if (!is_null($g_user) || $_GET['package']) if (!$_GET['package']) { -# Temporary until initial mirror is ready -echo sprintf( - '

%s broken dependencies. %s unmaintained packages. You can help!

', - 'data/missing-deps.i586.txt', count($missing_deps) == 0 ? 'no' : count($missing_deps), - 'data/unmaintained.txt', count($unmaintained), - 'https://wiki.mageia.org/en/Importing_packages' -); - -######################################### +$missing_deps_count = preg_match_all("//m", strtr(file_get_contents("http://check.mageia.org/cauldron/dependencies.rss"), "\n", " "), $matches); +$unmaintained_count = count(file(__DIR__ . '/data/unmaintained.txt')); +if ($missing_deps_count > 0 || $unmaintained_count > 0) { + echo "

"; + if ($missing_deps_count > 0) + echo "$missing_deps_count broken dependencies. "; + if ($unmaintained_count > 0) + echo "$unmaintained_count unmaintained packages. "; + echo 'You can help!

'; +} if ($upload_time) { echo sprintf('

Upload in progress for %s.

', timediff($upload_time)); -- cgit v1.2.1