Patchwork [1/1] base.bbclass: look in layers for SRC_URI with MACHINE overrides too

login
register
mail settings
Submitter Joshua Lock
Date Feb. 11, 2012, 12:30 a.m.
Message ID <dfc93718c100209c9897317d2399da7691a41070.1328920045.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/21155/
State New
Headers show

Comments

Joshua Lock - Feb. 11, 2012, 12:30 a.m.
The logic which looks for MACHINE overrides in SRC_URI and updates PACKAGE_ARCH
accordingly doesn't account for SRC_URI overrides in layers.

This patch may not be the cleanest approach to solving the issue but it works.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 meta/classes/base.bbclass |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
Otavio Salvador - Feb. 11, 2012, 1:02 p.m.
On Fri, Feb 10, 2012 at 22:30, Joshua Lock <josh@linux.intel.com> wrote:

> The logic which looks for MACHINE overrides in SRC_URI and updates
> PACKAGE_ARCH
> accordingly doesn't account for SRC_URI overrides in layers.
>

It seems to address the issue but I think we need to support bbappend with
overrides. If the layer doesn't use a machine override, then:

 * it is not machine depdendant, or
 * is a bug in the layer

People agree with this point of view?
Joshua Lock - Feb. 17, 2012, 11:01 p.m.
On 11/02/12 05:02, Otavio Salvador wrote:
> On Fri, Feb 10, 2012 at 22:30, Joshua Lock <josh@linux.intel.com
> <mailto:josh@linux.intel.com>> wrote:
>
>     The logic which looks for MACHINE overrides in SRC_URI and updates
>     PACKAGE_ARCH
>     accordingly doesn't account for SRC_URI overrides in layers.
>
>
> It seems to address the issue but I think we need to support bbappend
> with overrides.

Agreed, this patch adds hacky support for that. I am working on a more 
suitable patch to do this in a cleaner way.

If the layer doesn't use a machine override, then:
>
>   * it is not machine depdendant, or
>   * is a bug in the layer
>
> People agree with this point of view?

I do.

Cheers,
Joshua

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a26ac94..8fd5e53 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -460,6 +460,16 @@  python () {
             path = bb.data.expand(os.path.join("${FILE_DIRNAME}", p, "${MACHINE}"), d)
             if os.path.isdir(path):
                 paths.append(path)
+
+        # FILE is relative to the original recipe, for any bbappends in
+        # layers we need to look a little further
+        expaths = d.getVar('FILESEXTRAPATHS', True) or ""
+        for path in expaths.split(":"):
+            if len(path):
+                p = bb.data.expand(os.path.join(path, "${MACHINE}"), d)
+                if os.path.isdir(p):
+	            paths.append(p)
+
         if len(paths) != 0:
             for s in srcuri.split():
                 if not s.startswith("file://"):