aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorGravatar Atharva Lele <itsatharva@gmail.com>2019-08-01 08:16:38 +0530
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-08-01 10:23:19 +0200
commit8a20b9b5ae2deeae75b3cc70b8780df6c0d56ccf (patch)
tree35946f7a8e1a0f4871efce465de3750717d09015 /web
parenta5ef1799396fda8ca5c308ed260dcdac6612cd1c (diff)
downloadbuildroot-test-8a20b9b5ae2deeae75b3cc70b8780df6c0d56ccf.tar.gz
buildroot-test-8a20b9b5ae2deeae75b3cc70b8780df6c0d56ccf.tar.bz2
web/import.inc.php: support reading failure reason from reason file
Signed-off-by: Atharva Lele <itsatharva@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'web')
-rw-r--r--web/import.inc.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/web/import.inc.php b/web/import.inc.php
index a9b368f..6f878e0 100644
--- a/web/import.inc.php
+++ b/web/import.inc.php
@@ -230,17 +230,21 @@ function import_result($buildid, $filename)
if ($status == 0)
$reason = "none";
else {
- $tmp = Array();
- exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp);
- if (trim($tmp[0]))
- $reason = $tmp[0];
- else {
- exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp);
- if (trim($tmp[0]))
- $reason = trim($tmp[0]);
- else
- $reason = "unknown";
- }
+ if (file_exists($thisbuildfinaldir . "reason"))
+ $reason = trim(file_get_contents($thisbuildfinaldir . "reason", "r"));
+ else {
+ $tmp = Array();
+ exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp);
+ if (trim($tmp[0]))
+ $reason = $tmp[0];
+ else {
+ exec("tail -1 " . $thisbuildfinaldir . "build-time.log | grep :start: | cut -d':' -f4", $tmp);
+ if (trim($tmp[0]))
+ $reason = trim($tmp[0]);
+ else
+ $reason = "unknown";
+ }
+ }
}
/* Compress files that are typically too large and infrequently