diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-26 12:56:58 +0100 | 
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-26 14:40:54 +0100 | 
| commit | f50c5d36b2da9b36d56d95a7d89404509a1a3e9b (patch) | |
| tree | c2c685ec252a83c72fd9078615a40f4cc532a8ca /meta/lib/oe/packagedata.py | |
| parent | 9e31c748327e92b809330f4ad7b6aaecb2edf559 (diff) | |
| download | openembedded-core-f50c5d36b2da9b36d56d95a7d89404509a1a3e9b.tar.gz openembedded-core-f50c5d36b2da9b36d56d95a7d89404509a1a3e9b.tar.bz2 openembedded-core-f50c5d36b2da9b36d56d95a7d89404509a1a3e9b.zip | |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/packagedata.py')
| -rw-r--r-- | meta/lib/oe/packagedata.py | 42 | 
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):      return pkgdata +def all_pkgdatadirs(d): +    archs = [] +    tos = [] +    tvs = [] + +    archs.append(d.getVar("PACKAGE_ARCHS", True).split()) +    tos.append(d.getVar("TARGET_OS", True)) +    tvs.append(d.getVar("TARGET_VENDOR", True)) + +    variants = d.getVar("MULTILIB_VARIANTS", True) or "" +    for item in variants.split(): +        localdata = bb.data.createCopy(d) +        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item +        localdata.setVar("OVERRIDES", overrides) +        bb.data.update_data(localdata) + +        archs.append(localdata.getVar("PACKAGE_ARCHS", True).split()) +        tos.append(localdata.getVar("TARGET_OS", True)) +        tvs.append(localdata.getVar("TARGET_VENDOR", True)) + +    dirs = [] +    for i in range(len(archs)): +        for arch in archs[i]: +            dirs.append(arch + tvs[i] + "-" + tos[i] + "/runtime/") +    dirs.reverse() +    return dirs  +   def get_subpkgedata_fn(pkg, d): -    archs = d.expand("${PACKAGE_ARCHS}").split(" ") -    mlarchs = d.getVar("MULTILIB_PACKAGE_ARCHS", d) or None +    dirs = all_pkgdatadirs(d) -    if mlarchs: -        for mlarch in mlarchs.split(" "): -            if "_" in mlarch: -                prefix, split, new_arch = mlarch.partition("_") -                archs.append(new_arch) - -    archs.reverse()      pkgdata = d.expand('${TMPDIR}/pkgdata/') -    targetdir = d.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/') -    for arch in archs: -        fn = pkgdata + arch + targetdir + pkg +    for dir in dirs: +        fn = pkgdata + dir + pkg          if os.path.exists(fn):              return fn      return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg) | 
