summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/distrodata.bbclass32
1 files changed, 24 insertions, 8 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index 86a614a01e..72dded6e9e 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -1,6 +1,27 @@
1 1
2require conf/distro/include/distro_tracking_fields.inc 2require conf/distro/include/distro_tracking_fields.inc
3 3
4addhandler distro_eventhandler
5python distro_eventhandler() {
6 from bb.event import Handled, NotHandled
7 # if bb.event.getName(e) == "TaskStarted":
8
9 if bb.event.getName(e) == "BuildStarted":
10 """initialize log files."""
11 logpath = bb.data.getVar('LOG_DIR', e.data, 1)
12 bb.utils.mkdirhier(logpath)
13 logfile = os.path.join(logpath, "distrodata.%s.csv" % bb.data.getVar('DATETIME', e.data, 1))
14 if not os.path.exists(logfile):
15 slogfile = os.path.join(logpath, "distrodata.csv")
16 if os.path.exists(slogfile):
17 os.remove(slogfile)
18 os.system("touch %s" % logfile)
19 os.symlink(logfile, slogfile)
20 bb.data.setVar('LOG_FILE', logfile, e.data)
21
22 return NotHandled
23}
24
4addtask distrodata_np 25addtask distrodata_np
5do_distrodata_np[nostamp] = "1" 26do_distrodata_np[nostamp] = "1"
6python do_distrodata_np() { 27python do_distrodata_np() {
@@ -71,16 +92,11 @@ python do_distrodata_np() {
71addtask distrodata 92addtask distrodata
72do_distrodata[nostamp] = "1" 93do_distrodata[nostamp] = "1"
73python do_distrodata() { 94python do_distrodata() {
74 """initialize log files.""" 95
75 logpath = bb.data.getVar('LOG_DIR', d, 1) 96 logpath = bb.data.getVar('LOG_DIR', d, 1)
76 bb.utils.mkdirhier(logpath) 97 bb.utils.mkdirhier(logpath)
77 logfile = os.path.join(logpath, "distrodata.%s.csv" % bb.data.getVar('DATETIME', d, 1)) 98 logfile = os.path.join(logpath, "distrodata.csv")
78 if not os.path.exists(logfile): 99 bb.note("LOG_FILE: %s\n" % logfile)
79 slogfile = os.path.join(logpath, "distrodata.csv")
80 if os.path.exists(slogfile):
81 os.remove(slogfile)
82 os.system("touch %s" % logfile)
83 os.symlink(logfile, slogfile)
84 100
85 localdata = bb.data.createCopy(d) 101 localdata = bb.data.createCopy(d)
86 pn = bb.data.getVar("PN", d, True) 102 pn = bb.data.getVar("PN", d, True)