summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2020-08-27 14:07:04 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-28 07:08:37 +0100
commit5cde141ef1e037aa540963f8356c0c556b47964d (patch)
treeb968372d985a99a493f1cb6ff437aaf43a8a24f8 /meta/classes
parent7ac426e9bdb0b9e4808e0e19067c96beb384f580 (diff)
downloadpoky-5cde141ef1e037aa540963f8356c0c556b47964d.tar.gz
buildhistory.bbclass: Rework to use read_subpackage_metadata
Using this mechanism ensures that we have a single point to implement the loading of the package and subpackage meta data. This also then allows the buildhistory class to use the regular datastore vs it's own custom arrays for processing history items. (From OE-Core rev: 155ae6a3fe84c25904ffe7058e125bb4a28e2b45) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/buildhistory.bbclass49
1 files changed, 22 insertions, 27 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 805e976ac5..fbdb1d3161 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -258,20 +258,15 @@ python buildhistory_emit_pkghistory() {
258 rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') or "")) 258 rcpinfo.config = sortlist(oe.utils.squashspaces(d.getVar('PACKAGECONFIG') or ""))
259 write_recipehistory(rcpinfo, d) 259 write_recipehistory(rcpinfo, d)
260 260
261 pkgdest = d.getVar('PKGDEST') 261 bb.build.exec_func("read_subpackage_metadata", d)
262
262 for pkg in packagelist: 263 for pkg in packagelist:
263 pkgdata = {} 264 localdata = d.createCopy()
264 with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f: 265 localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
265 for line in f.readlines(): 266
266 item = line.rstrip('\n').split(': ', 1) 267 pkge = localdata.getVar("PKGE") or '0'
267 key = item[0] 268 pkgv = localdata.getVar("PKGV")
268 if key.endswith('_' + pkg): 269 pkgr = localdata.getVar("PKGR")
269 key = key[:-len(pkg)-1]
270 pkgdata[key] = item[1].encode('latin-1').decode('unicode_escape')
271
272 pkge = pkgdata.get('PKGE', '0')
273 pkgv = pkgdata['PKGV']
274 pkgr = pkgdata['PKGR']
275 # 270 #
276 # Find out what the last version was 271 # Find out what the last version was
277 # Make sure the version did not decrease 272 # Make sure the version did not decrease
@@ -288,31 +283,31 @@ python buildhistory_emit_pkghistory() {
288 283
289 pkginfo = PackageInfo(pkg) 284 pkginfo = PackageInfo(pkg)
290 # Apparently the version can be different on a per-package basis (see Python) 285 # Apparently the version can be different on a per-package basis (see Python)
291 pkginfo.pe = pkgdata.get('PE', '0') 286 pkginfo.pe = localdata.getVar("PE") or '0'
292 pkginfo.pv = pkgdata['PV'] 287 pkginfo.pv = localdata.getVar("PV")
293 pkginfo.pr = pkgdata['PR'] 288 pkginfo.pr = localdata.getVar("PR")
294 pkginfo.pkg = pkgdata['PKG'] 289 pkginfo.pkg = localdata.getVar("PKG")
295 pkginfo.pkge = pkge 290 pkginfo.pkge = pkge
296 pkginfo.pkgv = pkgv 291 pkginfo.pkgv = pkgv
297 pkginfo.pkgr = pkgr 292 pkginfo.pkgr = pkgr
298 pkginfo.rprovides = sortpkglist(oe.utils.squashspaces(pkgdata.get('RPROVIDES', ""))) 293 pkginfo.rprovides = sortpkglist(oe.utils.squashspaces(localdata.getVar("RPROVIDES") or ""))
299 pkginfo.rdepends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RDEPENDS', ""))) 294 pkginfo.rdepends = sortpkglist(oe.utils.squashspaces(localdata.getVar("RDEPENDS") or ""))
300 pkginfo.rrecommends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RRECOMMENDS', ""))) 295 pkginfo.rrecommends = sortpkglist(oe.utils.squashspaces(localdata.getVar("RRECOMMENDS") or ""))
301 pkginfo.rsuggests = sortpkglist(oe.utils.squashspaces(pkgdata.get('RSUGGESTS', ""))) 296 pkginfo.rsuggests = sortpkglist(oe.utils.squashspaces(localdata.getVar("RSUGGESTS") or ""))
302 pkginfo.rreplaces = sortpkglist(oe.utils.squashspaces(pkgdata.get('RREPLACES', ""))) 297 pkginfo.replaces = sortpkglist(oe.utils.squashspaces(localdata.getVar("RREPLACES") or ""))
303 pkginfo.rconflicts = sortpkglist(oe.utils.squashspaces(pkgdata.get('RCONFLICTS', ""))) 298 pkginfo.rconflicts = sortpkglist(oe.utils.squashspaces(localdata.getVar("RCONFLICTS") or ""))
304 pkginfo.files = oe.utils.squashspaces(pkgdata.get('FILES', "")) 299 pkginfo.files = oe.utils.squashspaces(localdata.getVar("FILES") or "")
305 for filevar in pkginfo.filevars: 300 for filevar in pkginfo.filevars:
306 pkginfo.filevars[filevar] = pkgdata.get(filevar, "") 301 pkginfo.filevars[filevar] = localdata.getVar(filevar) or ""
307 302
308 # Gather information about packaged files 303 # Gather information about packaged files
309 val = pkgdata.get('FILES_INFO', '') 304 val = localdata.getVar('FILES_INFO') or ''
310 dictval = json.loads(val) 305 dictval = json.loads(val)
311 filelist = list(dictval.keys()) 306 filelist = list(dictval.keys())
312 filelist.sort() 307 filelist.sort()
313 pkginfo.filelist = " ".join([shlex.quote(x) for x in filelist]) 308 pkginfo.filelist = " ".join([shlex.quote(x) for x in filelist])
314 309
315 pkginfo.size = int(pkgdata['PKGSIZE']) 310 pkginfo.size = int(localdata.getVar('PKGSIZE') or '0')
316 311
317 write_pkghistory(pkginfo, d) 312 write_pkghistory(pkginfo, d)
318 313