[oe-commits] Otavio Salvador : base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE

git at git.openembedded.org git at git.openembedded.org
Tue Apr 9 12:16:53 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 8ceef74dd4f662b4c7e3c170ce486e966ebebeff
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=8ceef74dd4f662b4c7e3c170ce486e966ebebeff

Author: Otavio Salvador <otavio at ossystems.com.br>
Date:   Mon Apr  8 18:42:44 2013 -0300

base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE

The use of SOC_FAMILY here is old code and SOC_FAMILY is now implemented by
MACHINEOVERRIDES behind the scenes. It therefore makes more sense to use
the replacement value in this code. Just like SOC_FAMILY, this is a ":"
delimited variable so we should iterate over the components, not use
the value directly.

Finally, MACHINEOVERRIDES contains MACHINE so we don't need to check that
directly.

This makes the functionality match what most users would expect it to do
and is also compatible with the way things previously worked.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/base.bbclass |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index abd6a52..641316d 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -515,11 +515,12 @@ python () {
         need_machine = d.getVar('COMPATIBLE_MACHINE', True)
         if need_machine:
             import re
-            this_machine = d.getVar('MACHINE', True)
-            if this_machine and not re.match(need_machine, this_machine):
-                this_soc_family = d.getVar('SOC_FAMILY', True)
-                if (this_soc_family and not re.match(need_machine, this_soc_family)) or not this_soc_family:
-                    raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
+            compat_machines = (d.getVar('MACHINEOVERRIDES', True) or "").split(":")
+            for m in compat_machines:
+                if re.match(need_machine, m):
+                    break
+            else:
+                raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE', True))
 
 
         bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()





More information about the Openembedded-commits mailing list