diff options
-rw-r--r-- | lib.php | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -32,8 +32,8 @@ function get_submitted_packages($upload_dir, $max_modified) chdir($upload_dir); $matches = array(); - $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\""); - $re = "!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.*)(\.src\.rpm(?:\.info)?|\.lock|\.done|\.upload)\s+(\d+\.\d+)$!m"; + $all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.lock' -o -name '*.done' -o -name '*.upload' -o -name '*.fail' \) -ctime -$max_modified -printf \"%p\t%T@\\n\""); + $re = "!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.*)(\.src\.rpm(?:\.info)?|\.lock|\.done|\.upload|\.fail)\s+(\d+\.\d+)$!m"; $r = preg_match_all($re, $all_files, $matches, @@ -83,13 +83,15 @@ function get_refined_packages_list($list_of_files, $package = null, $user = null 'package' => '' ); } - $status = $val[1]; + if ($val[1] != 'failure') { + // failures are detected with .fail files + $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') { @@ -125,7 +127,18 @@ function get_refined_packages_list($list_of_files, $package = null, $user = null if ($pkgs[$key]['buildtime']['diff'] < 43200) { $buildtime_total[$key] = $pkgs[$key]['buildtime']['diff']; } + } else if ($ext == '.fail') { + $arch = $data; + if (!$pkgs[$key]['status']['fail']) { + $pkgs[$key]['status']['fail'] = array(); + } + $pkgs[$key]['status']['fail'][$arch] = 1; + if (in_array($arch, $mandatory_arches)) { + $status = 'failure'; + } } + + $pkgs[$key]['status'][$status] = 1; } // filter packages if a package name was provided |