summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/packagedata.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-26 12:56:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-26 15:02:25 +0100
commit42e8c8056719326b68b1602e0699eba00a924d2b (patch)
tree277665763728ca4567a3770b09f045c06a0c244d /meta/lib/oe/packagedata.py
parent8593c6c1d8995f449a41a99c6e3242e2e58e79a5 (diff)
downloadpoky-42e8c8056719326b68b1602e0699eba00a924d2b.tar.gz
packagedata/multilib: Fix search patch for multilib builds
The current multilib search path code for packagedata is flawed since it doesn't correctly handle changes in the TARGET_VENDOR/TARGET_OS that multilib may make. This patch enhances the code to correctly build the search paths so multilib packagedata is found correctly. (From OE-Core rev: f50c5d36b2da9b36d56d95a7d89404509a1a3e9b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/packagedata.py')
-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)