summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2019-09-18 09:31:25 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-19 10:54:32 +0100
commit0f866a92e18f992ab3833ce5df79bdd24593b7ca (patch)
tree16d626a6756b307e19049794fd0639599cad8ab6 /meta
parent9a6cfc0fee87519e835afa74a94f349b744c39a3 (diff)
downloadpoky-0f866a92e18f992ab3833ce5df79bdd24593b7ca.tar.gz
report-error.bbclass: add local.conf/auto.conf into error report
sometimes, it is not enough to reproduce a failed build with current info on error reports web, add local.conf/auto.conf into error report to make it more easier to reproduce failed build Note: this need work together with change in repo error-report-web, which will display local.conf and auto.conf as Error Details [YOCTO #13252] (From OE-Core rev: 7adf9707c04d8ef6bcd8d8bda555687f705e6ee6) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/report-error.bbclass15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
index 1c55abfbf3..ea043b23e1 100644
--- a/meta/classes/report-error.bbclass
+++ b/meta/classes/report-error.bbclass
@@ -25,6 +25,19 @@ def errorreport_savedata(e, newdata, file):
25 json.dump(newdata, f, indent=4, sort_keys=True) 25 json.dump(newdata, f, indent=4, sort_keys=True)
26 return datafile 26 return datafile
27 27
28def get_conf_data(e, filename):
29 builddir = e.data.getVar('TOPDIR')
30 filepath = os.path.join(builddir, "conf", filename)
31 jsonstring = ""
32 if os.path.exists(filepath):
33 with open(filepath, 'r') as f:
34 for line in f.readlines():
35 if line.startswith("#") or len(line.strip()) == 0:
36 continue
37 else:
38 jsonstring=jsonstring + line
39 return jsonstring
40
28python errorreport_handler () { 41python errorreport_handler () {
29 import json 42 import json
30 import codecs 43 import codecs
@@ -51,6 +64,8 @@ python errorreport_handler () {
51 data['failures'] = [] 64 data['failures'] = []
52 data['component'] = " ".join(e.getPkgs()) 65 data['component'] = " ".join(e.getPkgs())
53 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data)) 66 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
67 data['local_conf'] = get_conf_data(e, 'local.conf')
68 data['auto_conf'] = get_conf_data(e, 'auto.conf')
54 lock = bb.utils.lockfile(datafile + '.lock') 69 lock = bb.utils.lockfile(datafile + '.lock')
55 errorreport_savedata(e, data, "error-report.txt") 70 errorreport_savedata(e, data, "error-report.txt")
56 bb.utils.unlockfile(lock) 71 bb.utils.unlockfile(lock)