Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] utils.bbclass: Fix override ordering for FILESPATH
Date: Wed, 09 Oct 2013 23:42:25 +0100	[thread overview]
Message-ID: <1381358545.29912.50.camel@ted> (raw)

Currently the overrides are being applied backwards. This means something which is
platform specific is overriding something which is machine specific which
is clearly not intended.

This patch corrects the ordering to match the normal expected behaviour of
OVERRIDES.

Secondly, all overrides are being searched for each path in turn. What should
really happen is that we should look for the highest priority override (e.g. distro
or machine) in each layer, then move on to platform/tune (e.g. armv7a) and
then to arch (e.g. arm). This patch therefore also reverses the for loops
to achieve this behaviour and give the result the user would expect.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index d1f6563..0a533af 100644
--- a/meta/classes/utils.bbclass
+++ b/meta/classes/utils.bbclass
@@ -307,10 +307,11 @@ def base_set_filespath(path, d):
     if extrapaths != "":
         path = extrapaths.split(":") + path
     # The ":" ensures we have an 'empty' override
-    overrides = ((d.getVar("FILESOVERRIDES", True) or "") + ":").split(":")
-    for p in path:
-        if p != "": 
-            for o in overrides:
+    overrides = (":" + (d.getVar("FILESOVERRIDES", True) or "")).split(":")
+    overrides.reverse()
+    for o in overrides:
+        for p in path:
+            if p != "": 
                 filespath.append(os.path.join(p, o))
     return ":".join(filespath)
 




             reply	other threads:[~2013-10-09 22:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 22:42 Richard Purdie [this message]
2013-10-28 14:10 ` SRC_URI computing order Eric Bénard
2013-10-29  3:45   ` Khem Raj
2013-10-29  7:28     ` Eric Bénard
2013-10-30 15:15       ` Richard Purdie
2013-11-02  8:47         ` Eric Bénard
2013-11-03 22:16           ` Andrea Adami
2013-11-03 23:10             ` Richard Purdie
2013-11-04 22:13               ` Andrea Adami
2013-11-06  8:45                 ` Andrea Adami
2013-11-07 23:20                   ` Richard Purdie
2013-11-08 11:55                     ` Otavio Salvador
2013-11-04  8:33             ` Eric Bénard
2013-11-01 15:36   ` Eric Bénard
2013-11-01 18:16     ` Richard Purdie
2013-11-02  8:45       ` Eric Bénard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381358545.29912.50.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox