summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/packagedata.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-09-01 08:44:40 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-03 09:53:28 +0100
commit7ec54b174304e940ec66f21ac512f7b50fa637b3 (patch)
treeb072a6f30ca0e48d5ddced075a58257b232347b4 /meta/lib/oe/packagedata.py
parentd521ba8c32cc1028304369b754d9d9dbf0f0e60d (diff)
downloadpoky-7ec54b174304e940ec66f21ac512f7b50fa637b3.tar.gz
classes/package: Add extended packaged data
Adds extended package data which is encoded as JSON which allows it to encode more structure than the "flat" package data files. The extended data might be much larger than the standard package data, so it is not read by default and instead requires oe.packagedata.read_subpkgdata_extended() to be called Currently, the file sizes and ELF debug sources are saved off into the extended package data (From OE-Core rev: db9cf430e54ae68da80fbc3fba80ce88d8df164d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/packagedata.py')
-rw-r--r--meta/lib/oe/packagedata.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 0b17897e40..02c81e5a52 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -57,6 +57,18 @@ def read_subpkgdata_dict(pkg, d):
57 ret[newvar] = subd[var] 57 ret[newvar] = subd[var]
58 return ret 58 return ret
59 59
60def read_subpkgdata_extended(pkg, d):
61 import json
62 import bb.compress.zstd
63
64 fn = d.expand("${PKGDATA_DIR}/extended/%s.json.zstd" % pkg)
65 try:
66 num_threads = int(d.getVar("BB_NUMBER_THREADS"))
67 with bb.compress.zstd.open(fn, "rt", encoding="utf-8", num_threads=num_threads) as f:
68 return json.load(f)
69 except FileNotFoundError:
70 return None
71
60def _pkgmap(d): 72def _pkgmap(d):
61 """Return a dictionary mapping package to recipe name.""" 73 """Return a dictionary mapping package to recipe name."""
62 74