summaryrefslogtreecommitdiffstats
path: root/meta/classes/distrodata.bbclass
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@intel.com>2010-10-15 13:51:33 -0700
committerSaul Wold <Saul.Wold@intel.com>2010-10-15 13:55:46 -0700
commit77176d56fdd4158b34769fecca764a5b9c87e04b (patch)
tree732c27c73a4e3a1690b6566978eb907c7ff503a8 /meta/classes/distrodata.bbclass
parent2c40e13634ab10e12cd1325b18e226b2f6db2749 (diff)
downloadpoky-77176d56fdd4158b34769fecca764a5b9c87e04b.tar.gz
distrodata: Modify Distro tracking spreadsheet
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Diffstat (limited to 'meta/classes/distrodata.bbclass')
-rw-r--r--meta/classes/distrodata.bbclass59
1 files changed, 50 insertions, 9 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index c317083653..f6642f0f13 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -19,6 +19,12 @@ python distro_eventhandler() {
19 os.symlink(logfile, slogfile) 19 os.symlink(logfile, slogfile)
20 bb.data.setVar('LOG_FILE', logfile, e.data) 20 bb.data.setVar('LOG_FILE', logfile, e.data)
21 21
22 lf = bb.utils.lockfile(logfile + ".lock")
23 f = open(logfile, "a")
24 f.write("Package,Description,Maintainer,License,ChkSum,Status,VerMatch,Version,Upsteam,Non-Update,Reason,Recipe Status\n")
25 f.close()
26 bb.utils.unlockfile(lf)
27
22 return NotHandled 28 return NotHandled
23} 29}
24 30
@@ -29,6 +35,12 @@ python do_distrodata_np() {
29 pn = bb.data.getVar("PN", d, True) 35 pn = bb.data.getVar("PN", d, True)
30 bb.note("Package Name: %s" % pn) 36 bb.note("Package Name: %s" % pn)
31 37
38 import oe.distro_check as dist_check
39 tmpdir = bb.data.getVar('TMPDIR', d, 1)
40 distro_check_dir = os.path.join(tmpdir, "distro_check")
41 datetime = bb.data.getVar('DATETIME', localdata, 1)
42 dist_check.update_distro_data(distro_check_dir, datetime)
43
32 if pn.find("-native") != -1: 44 if pn.find("-native") != -1:
33 pnstripped = pn.split("-native") 45 pnstripped = pn.split("-native")
34 bb.note("Native Split: %s" % pnstripped) 46 bb.note("Native Split: %s" % pnstripped)
@@ -51,6 +63,10 @@ python do_distrodata_np() {
51 pname = bb.data.getVar('PN', localdata, True) 63 pname = bb.data.getVar('PN', localdata, True)
52 pcurver = bb.data.getVar('PV', localdata, True) 64 pcurver = bb.data.getVar('PV', localdata, True)
53 pdesc = bb.data.getVar('DESCRIPTION', localdata, True) 65 pdesc = bb.data.getVar('DESCRIPTION', localdata, True)
66 if pdesc is not None:
67 pdesc = pdesc.replace(',','')
68 pdesc = pdesc.replace('\n','')
69
54 pgrp = bb.data.getVar('SECTION', localdata, True) 70 pgrp = bb.data.getVar('SECTION', localdata, True)
55 plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_') 71 plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_')
56 if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True): 72 if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True):
@@ -64,18 +80,20 @@ python do_distrodata_np() {
64 hasrstatus="0" 80 hasrstatus="0"
65 81
66 rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True) 82 rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True)
83 if rstatus is not None:
84 rstatus = rstatus.replace(',','')
67 85
68 pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True) 86 pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True)
69 if pcurver == pupver: 87 if pcurver == pupver:
70 vermatch="1" 88 vermatch="1"
71 else: 89 else:
72 vermatch="0" 90 vermatch="0"
73
74 noupdate_reason = bb.data.getVar('RECIPE_NO_UPDATE_REASON', localdata, True) 91 noupdate_reason = bb.data.getVar('RECIPE_NO_UPDATE_REASON', localdata, True)
75 if noupdate_reason is None: 92 if noupdate_reason is None:
76 noupdate="0" 93 noupdate="0"
77 else: 94 else:
78 noupdate="1" 95 noupdate="1"
96 noupdate_reason = noupdate_reason.replace(',','')
79 97
80 ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True) 98 ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True)
81 maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True) 99 maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True)
@@ -83,9 +101,14 @@ python do_distrodata_np() {
83 rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True) 101 rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True)
84 dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True) 102 dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True)
85 rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True) 103 rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True)
86 104 result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
87 bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s, %s, %s, %s\n" % \ 105
88 (pname, maintainer, plicense, pchksum, hasrstatus, vermatch, pcurver, pupver, noupdate, noupdate_reason, rstatus)) 106 bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s,%s, %s, %s, %s\n" % \
107 (pname, pdesc, maintainer, plicense, pchksum, hasrstatus, vermatch, pcurver, pupver, noupdate, noupdate_reason, rstatus))
108 line = pn
109 for i in result:
110 line = line + "," + i
111 bb.note("%s\n" % line)
89} 112}
90 113
91addtask distrodata 114addtask distrodata
@@ -94,9 +117,14 @@ python do_distrodata() {
94 logpath = bb.data.getVar('LOG_DIR', d, 1) 117 logpath = bb.data.getVar('LOG_DIR', d, 1)
95 bb.utils.mkdirhier(logpath) 118 bb.utils.mkdirhier(logpath)
96 logfile = os.path.join(logpath, "distrodata.csv") 119 logfile = os.path.join(logpath, "distrodata.csv")
97 bb.note("LOG_FILE: %s\n" % logfile)
98 120
121 import oe.distro_check as dist_check
99 localdata = bb.data.createCopy(d) 122 localdata = bb.data.createCopy(d)
123 tmpdir = bb.data.getVar('TMPDIR', d, 1)
124 distro_check_dir = os.path.join(tmpdir, "distro_check")
125 datetime = bb.data.getVar('DATETIME', localdata, 1)
126 dist_check.update_distro_data(distro_check_dir, datetime)
127
100 pn = bb.data.getVar("PN", d, True) 128 pn = bb.data.getVar("PN", d, True)
101 bb.note("Package Name: %s" % pn) 129 bb.note("Package Name: %s" % pn)
102 130
@@ -122,6 +150,10 @@ python do_distrodata() {
122 pname = bb.data.getVar('PN', localdata, True) 150 pname = bb.data.getVar('PN', localdata, True)
123 pcurver = bb.data.getVar('PV', localdata, True) 151 pcurver = bb.data.getVar('PV', localdata, True)
124 pdesc = bb.data.getVar('DESCRIPTION', localdata, True) 152 pdesc = bb.data.getVar('DESCRIPTION', localdata, True)
153 if pdesc is not None:
154 pdesc = pdesc.replace(',','')
155 pdesc = pdesc.replace('\n','')
156
125 pgrp = bb.data.getVar('SECTION', localdata, True) 157 pgrp = bb.data.getVar('SECTION', localdata, True)
126 plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_') 158 plicense = bb.data.getVar('LICENSE', localdata, True).replace(',','_')
127 if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True): 159 if bb.data.getVar('LIC_FILES_CHKSUM', localdata, True):
@@ -135,6 +167,8 @@ python do_distrodata() {
135 hasrstatus="0" 167 hasrstatus="0"
136 168
137 rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True) 169 rstatus = bb.data.getVar('RECIPE_STATUS', localdata, True)
170 if rstatus is not None:
171 rstatus = rstatus.replace(',','')
138 172
139 pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True) 173 pupver = bb.data.getVar('RECIPE_LATEST_VERSION', localdata, True)
140 if pcurver == pupver: 174 if pcurver == pupver:
@@ -147,6 +181,7 @@ python do_distrodata() {
147 noupdate="0" 181 noupdate="0"
148 else: 182 else:
149 noupdate="1" 183 noupdate="1"
184 noupdate_reason = noupdate_reason.replace(',','')
150 185
151 ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True) 186 ris = bb.data.getVar('RECIPE_INTEL_SECTION', localdata, True)
152 maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True) 187 maintainer = bb.data.getVar('RECIPE_MAINTAINER', localdata, True)
@@ -154,13 +189,19 @@ python do_distrodata() {
154 rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True) 189 rlrd = bb.data.getVar('RECIPE_LATEST_RELEASE_DATE', localdata, True)
155 dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True) 190 dc = bb.data.getVar('DEPENDENCY_CHECK', localdata, True)
156 rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True) 191 rc = bb.data.getVar('RECIPE_COMMENTS', localdata, True)
192 # do the comparison
193 result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
157 194
158 lf = bb.utils.lockfile(logfile + ".lock") 195 lf = bb.utils.lockfile(logfile + ".lock")
159 f = open(logfile, "a") 196 f = open(logfile, "a")
160 f.write("%s,%s,%s,%s,%s,%s,%s,%s, %s, %s, %s\n" % \ 197 f.write("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s," % \
161 (pname, maintainer, plicense, pchksum, hasrstatus, vermatch, pcurver, pupver, noupdate, noupdate_reason, rstatus)) 198 (pname, pdesc, maintainer, plicense, pchksum, hasrstatus, vermatch, pcurver, pupver, noupdate, noupdate_reason, rstatus))
162 f.close() 199 line = ""
163 bb.utils.unlockfile(lf) 200 for i in result:
201 line = line + "," + i
202 f.write(line + "\n")
203 f.close()
204 bb.utils.unlockfile(lf)
164} 205}
165 206
166addtask distrodataall after do_distrodata 207addtask distrodataall after do_distrodata