Patchwork [v2] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE

login
register
mail settings
Submitter Otavio Salvador
Date April 8, 2013, 1:55 p.m.
Message ID <1365429341-14345-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/47621/
State New
Headers show

Comments

Otavio Salvador - April 8, 2013, 1:55 p.m.
When a SOC_FAMILY has more than one value, split by ':' as usual
OVERRIDES, this were not being properly checked in COMPATIBLE_MACHINE
matching as we need to iterate over each SoC family and check if it is
compatible or not.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes for v2:
- Properly handle machine so the error message clearly cite the right
  machine name (Eric)

 meta/classes/base.bbclass | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index abd6a52..080caa8 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -516,10 +516,13 @@  python () {
         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 = [this_machine]
+            compat_machines.extend((d.getVar('SOC_FAMILY', 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)" % this_machine)
 
 
         bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()