summaryrefslogtreecommitdiffstats
path: root/meta/classes/report-error.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/report-error.bbclass')
-rw-r--r--meta/classes/report-error.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
index 5bb231efc1..d6fdd364ad 100644
--- a/meta/classes/report-error.bbclass
+++ b/meta/classes/report-error.bbclass
@@ -10,7 +10,7 @@ ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
10 10
11def errorreport_getdata(e): 11def errorreport_getdata(e):
12 import codecs 12 import codecs
13 logpath = e.data.getVar('ERR_REPORT_DIR', True) 13 logpath = e.data.getVar('ERR_REPORT_DIR')
14 datafile = os.path.join(logpath, "error-report.txt") 14 datafile = os.path.join(logpath, "error-report.txt")
15 with codecs.open(datafile, 'r', 'utf-8') as f: 15 with codecs.open(datafile, 'r', 'utf-8') as f:
16 data = f.read() 16 data = f.read()
@@ -19,7 +19,7 @@ def errorreport_getdata(e):
19def errorreport_savedata(e, newdata, file): 19def errorreport_savedata(e, newdata, file):
20 import json 20 import json
21 import codecs 21 import codecs
22 logpath = e.data.getVar('ERR_REPORT_DIR', True) 22 logpath = e.data.getVar('ERR_REPORT_DIR')
23 datafile = os.path.join(logpath, file) 23 datafile = os.path.join(logpath, file)
24 with codecs.open(datafile, 'w', 'utf-8') as f: 24 with codecs.open(datafile, 'w', 'utf-8') as f:
25 json.dump(newdata, f, indent=4, sort_keys=True) 25 json.dump(newdata, f, indent=4, sort_keys=True)
@@ -29,18 +29,18 @@ python errorreport_handler () {
29 import json 29 import json
30 import codecs 30 import codecs
31 31
32 logpath = e.data.getVar('ERR_REPORT_DIR', True) 32 logpath = e.data.getVar('ERR_REPORT_DIR')
33 datafile = os.path.join(logpath, "error-report.txt") 33 datafile = os.path.join(logpath, "error-report.txt")
34 34
35 if isinstance(e, bb.event.BuildStarted): 35 if isinstance(e, bb.event.BuildStarted):
36 bb.utils.mkdirhier(logpath) 36 bb.utils.mkdirhier(logpath)
37 data = {} 37 data = {}
38 machine = e.data.getVar("MACHINE", True) 38 machine = e.data.getVar("MACHINE")
39 data['machine'] = machine 39 data['machine'] = machine
40 data['build_sys'] = e.data.getVar("BUILD_SYS", True) 40 data['build_sys'] = e.data.getVar("BUILD_SYS")
41 data['nativelsb'] = e.data.getVar("NATIVELSBSTRING", True) 41 data['nativelsb'] = e.data.getVar("NATIVELSBSTRING")
42 data['distro'] = e.data.getVar("DISTRO", True) 42 data['distro'] = e.data.getVar("DISTRO")
43 data['target_sys'] = e.data.getVar("TARGET_SYS", True) 43 data['target_sys'] = e.data.getVar("TARGET_SYS")
44 data['failures'] = [] 44 data['failures'] = []
45 data['component'] = " ".join(e.getPkgs()) 45 data['component'] = " ".join(e.getPkgs())
46 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data)) 46 data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
@@ -51,7 +51,7 @@ python errorreport_handler () {
51 elif isinstance(e, bb.build.TaskFailed): 51 elif isinstance(e, bb.build.TaskFailed):
52 task = e.task 52 task = e.task
53 taskdata={} 53 taskdata={}
54 log = e.data.getVar('BB_LOGFILE', True) 54 log = e.data.getVar('BB_LOGFILE')
55 taskdata['package'] = e.data.expand("${PF}") 55 taskdata['package'] = e.data.expand("${PF}")
56 taskdata['task'] = task 56 taskdata['task'] = task
57 if log: 57 if log:
@@ -61,7 +61,7 @@ python errorreport_handler () {
61 61
62 # Replace host-specific paths so the logs are cleaner 62 # Replace host-specific paths so the logs are cleaner
63 for d in ("TOPDIR", "TMPDIR"): 63 for d in ("TOPDIR", "TMPDIR"):
64 s = e.data.getVar(d, True) 64 s = e.data.getVar(d)
65 if s: 65 if s:
66 logdata = logdata.replace(s, d) 66 logdata = logdata.replace(s, d)
67 67
@@ -92,7 +92,7 @@ python errorreport_handler () {
92 bb.utils.unlockfile(lock) 92 bb.utils.unlockfile(lock)
93 failures = jsondata['failures'] 93 failures = jsondata['failures']
94 if(len(failures) > 0): 94 if(len(failures) > 0):
95 filename = "error_report_" + e.data.getVar("BUILDNAME", True)+".txt" 95 filename = "error_report_" + e.data.getVar("BUILDNAME")+".txt"
96 datafile = errorreport_savedata(e, jsondata, filename) 96 datafile = errorreport_savedata(e, jsondata, filename)
97 bb.note("The errors for this build are stored in %s\nYou can send the errors to a reports server by running:\n send-error-report %s [-s server]" % (datafile, datafile)) 97 bb.note("The errors for this build are stored in %s\nYou can send the errors to a reports server by running:\n send-error-report %s [-s server]" % (datafile, datafile))
98 bb.note("The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.") 98 bb.note("The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.")