summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/packagedata.py42
1 files changed, 30 insertions, 12 deletions
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 5f897ff31f..ce92a7ef8e 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -23,21 +23,39 @@ def read_pkgdatafile(fn):
23 23
24 return pkgdata 24 return pkgdata
25 25
26def all_pkgdatadirs(d):
27 archs = []
28 tos = []
29 tvs = []
30
31 archs.append(d.getVar("PACKAGE_ARCHS", True).split())
32 tos.append(d.getVar("TARGET_OS", True))
33 tvs.append(d.getVar("TARGET_VENDOR", True))
34
35 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
36 for item in variants.split():
37 localdata = bb.data.createCopy(d)
38 overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
39 localdata.setVar("OVERRIDES", overrides)
40 bb.data.update_data(localdata)
41
42 archs.append(localdata.getVar("PACKAGE_ARCHS", True).split())
43 tos.append(localdata.getVar("TARGET_OS", True))
44 tvs.append(localdata.getVar("TARGET_VENDOR", True))
45
46 dirs = []
47 for i in range(len(archs)):
48 for arch in archs[i]:
49 dirs.append(arch + tvs[i] + "-" + tos[i] + "/runtime/")
50 dirs.reverse()
51 return dirs
52
26def get_subpkgedata_fn(pkg, d): 53def get_subpkgedata_fn(pkg, d):
27 archs = d.expand("${PACKAGE_ARCHS}").split(" ") 54 dirs = all_pkgdatadirs(d)
28 mlarchs = d.getVar("MULTILIB_PACKAGE_ARCHS", d) or None
29 55
30 if mlarchs:
31 for mlarch in mlarchs.split(" "):
32 if "_" in mlarch:
33 prefix, split, new_arch = mlarch.partition("_")
34 archs.append(new_arch)
35
36 archs.reverse()
37 pkgdata = d.expand('${TMPDIR}/pkgdata/') 56 pkgdata = d.expand('${TMPDIR}/pkgdata/')
38 targetdir = d.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/') 57 for dir in dirs:
39 for arch in archs: 58 fn = pkgdata + dir + pkg
40 fn = pkgdata + arch + targetdir + pkg
41 if os.path.exists(fn): 59 if os.path.exists(fn):
42 return fn 60 return fn
43 return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg) 61 return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)