summaryrefslogtreecommitdiffstats
path: root/autobuild
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2021-07-06 16:34:47 +0000
committerPascal Terjan <pterjan@mageia.org>2021-07-06 16:34:47 +0000
commit8cfb1e2f00c1d427200b098c3111ef3cb191fb65 (patch)
tree7d924be2889317a852bfc7e24da5b38304758c72 /autobuild
parent754473b9fc5a3f0171164d44112986cfd3b59e67 (diff)
downloadpkgsubmit-8cfb1e2f00c1d427200b098c3111ef3cb191fb65.tar
pkgsubmit-8cfb1e2f00c1d427200b098c3111ef3cb191fb65.tar.gz
pkgsubmit-8cfb1e2f00c1d427200b098c3111ef3cb191fb65.tar.bz2
pkgsubmit-8cfb1e2f00c1d427200b098c3111ef3cb191fb65.tar.xz
pkgsubmit-8cfb1e2f00c1d427200b098c3111ef3cb191fb65.zip
Fix inifinite loop on missing files
status.core.log should always be there but some from 2017/208 are missing.
Diffstat (limited to 'autobuild')
-rw-r--r--autobuild/results.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/autobuild/results.php b/autobuild/results.php
index f2dfa18..da18802 100644
--- a/autobuild/results.php
+++ b/autobuild/results.php
@@ -67,17 +67,20 @@ $prev_failure = Array();
if ($prev) {
$status_name = array_shift(glob("cauldron/*/core/$prev/status.core.log"));
$status_file = fopen($status_name, "r");
- while (!feof($status_file)) {
- $line = fgets($status_file);
- if (preg_match("/^(.*): (.*)$/", $line, $matches)) {
- $rpm = parse_package($matches[1]);
- $status = $matches[2];
- if ($status != "ok" && $status != "unknown" && $status != "not_on_this_arch") {
- $prev_failure[$rpm['package']] = 1;
+ if ($status_file !== false) {
+ // The file should always be there but better not get an infinite loop flooding the logs when it disappears
+ while (!feof($status_file)) {
+ $line = fgets($status_file);
+ if (preg_match("/^(.*): (.*)$/", $line, $matches)) {
+ $rpm = parse_package($matches[1]);
+ $status = $matches[2];
+ if ($status != "ok" && $status != "unknown" && $status != "not_on_this_arch") {
+ $prev_failure[$rpm['package']] = 1;
+ }
}
}
+ fclose($status_file);
}
- fclose($status_file);
}
$success = Array();