From d1e939580ceb38b2c83e4193cb1d99d55f05e7f2 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 25 Nov 2020 22:10:03 +0000 Subject: Support .kill files --- lib.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib.php') diff --git a/lib.php b/lib.php index 258710d..dac2441 100644 --- a/lib.php +++ b/lib.php @@ -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' -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"; + $all_files = shell_exec("find \( -name '*.rpm' -o -name '*.src.rpm.info' -o -name '*.lock' -o -name '*.done' -o -name '*.upload' -o -name '*.fail' -o -name '*.kill' \) -ctime -$max_modified -printf \"%p\t%T@\\n\""); + $re = "!^\./(\w+)/((\w+)/(\w+)/(\w+)/(\d+)\.(\w+)\.(\w+)\.(\d+))_?(.*)(\.src\.rpm(?:\.info)?|\.lock|\.done|\.upload|\.fail|\.kill)\s+(\d+\.\d+)$!m"; $r = preg_match_all($re, $all_files, $matches, @@ -136,10 +136,18 @@ function get_refined_packages_list($list_of_files, $package = null, $user = null if (!isset($pkgs[$key]['status']['fail'])) { $pkgs[$key]['status']['fail'] = array(); } - $pkgs[$key]['status']['fail'][$arch] = 1; + if (!isset($pkgs[$key]['status']['kill'][$arch])) { + $pkgs[$key]['status']['fail'][$arch] = 1; + } if (in_array($arch, $mandatory_arches) || $arch == 'noarch') { $status = 'failure'; } + } else if ($ext == '.kill') { + if (!isset($pkgs[$key]['status']['kill'])) { + $pkgs[$key]['status']['kill'] = array(); + } + $pkgs[$key]['status']['kill'][$arch] = 1; + unset($pkgs[$key]['status']['fail'][$arch]); } if ($status !== '') { -- cgit v1.2.1