diff options
author | Pascal Terjan <pterjan@mageia.org> | 2018-04-28 15:22:58 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2018-04-28 15:22:58 +0000 |
commit | 09e3290cf424f1635c69659bd271fae6951fbac3 (patch) | |
tree | 648cdc7c41a33ff213d4d1ae91cdf300dedac726 | |
parent | 3a9215e6589464e98548e1e74dbd22a31070e46b (diff) | |
download | pkgsubmit-09e3290cf424f1635c69659bd271fae6951fbac3.tar pkgsubmit-09e3290cf424f1635c69659bd271fae6951fbac3.tar.gz pkgsubmit-09e3290cf424f1635c69659bd271fae6951fbac3.tar.bz2 pkgsubmit-09e3290cf424f1635c69659bd271fae6951fbac3.tar.xz pkgsubmit-09e3290cf424f1635c69659bd271fae6951fbac3.zip |
Do not try working on FALSE file handle if "latest" link is broken, this causes a lot of warnings in logs
-rw-r--r-- | autobuild/broken.php | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/autobuild/broken.php b/autobuild/broken.php index 68459f8..405abaa 100644 --- a/autobuild/broken.php +++ b/autobuild/broken.php @@ -21,30 +21,32 @@ $base_dir = "cauldron/x86_64/core/$run"; $status_name = "$base_dir/status.core.log"; $status_file = fopen($status_name, "r"); -while (!feof($status_file)) { - $line = fgets($status_file); - if (preg_match("/^(.*): (.*)$/", $line, $matches)) { - $rpm = $matches[1]; - $status = $matches[2]; - if ($status != "ok" && $status != "unknown" && $status != "not_on_this_arch"){ - preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches); - $package = $matches[1]; - $version = $matches[2]; - if($packages[$package]) { - $build_stat = stat("$base_dir/$rpm"); - $pkg_stat = stat($srpm_dir.$packages[$package]); - if ($pkg_stat['mtime'] <= $build_stat['mtime']) { - $failure[$rpm] = $status; +if ($status_file) { + while (!feof($status_file)) { + $line = fgets($status_file); + if (preg_match("/^(.*): (.*)$/", $line, $matches)) { + $rpm = $matches[1]; + $status = $matches[2]; + if ($status != "ok" && $status != "unknown" && $status != "not_on_this_arch"){ + preg_match("/(.*)-([^-]*-[^-]*mga)[1-9].src.rpm/", $rpm, $matches); + $package = $matches[1]; + $version = $matches[2]; + if($packages[$package]) { + $build_stat = stat("$base_dir/$rpm"); + $pkg_stat = stat($srpm_dir.$packages[$package]); + if ($pkg_stat['mtime'] <= $build_stat['mtime']) { + $failure[$rpm] = $status; + } } } } } -} -fclose($status_file); + fclose($status_file); -ksort($failure); + ksort($failure); -foreach ($failure as $rpm => $error) { - echo "$rpm: $error\n"; + foreach ($failure as $rpm => $error) { + echo "$rpm: $error\n"; + } } ?> |