summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <dev@blino.org>2015-11-03 01:27:33 +0100
committerOlivier Blin <dev@blino.org>2015-11-03 01:27:33 +0100
commitb2717138511a79ede4384438936e0fbb670d4ad2 (patch)
tree4375ee8fbb5e3187dfb1476131714ab84e6a765a
parent9caf90a890c629806129e430625932298fe6a31c (diff)
downloadpkgsubmit-b2717138511a79ede4384438936e0fbb670d4ad2.tar
pkgsubmit-b2717138511a79ede4384438936e0fbb670d4ad2.tar.gz
pkgsubmit-b2717138511a79ede4384438936e0fbb670d4ad2.tar.bz2
pkgsubmit-b2717138511a79ede4384438936e0fbb670d4ad2.tar.xz
pkgsubmit-b2717138511a79ede4384438936e0fbb670d4ad2.zip
Detect failures for mandatory arches only using .fail files
Previously, we just used the failures directory to check if any failure had happened for the submit prefix. But this does not work properly when non-mandatory architectures are used, their failure should not be fatal. Instead, use .fail files and mark as a failure only if failed for one of the mandatory architectures.
-rw-r--r--lib.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib.php b/lib.php
index 403b6c9..7d89e41 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' \) -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