Skip to contentSkip to conversation

base.bbclass: Add matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE

PATCH New Otavio Salvador 1 participant 1 message Apr 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 base.bbclass: Add matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE

When a MACHINEOVERRIDES 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.

The code has been change from SOC_FAMILY to MACHINEOVERRIDES as the former in fact appends the value to the later, so the right variable to match is MACHINEOVERRIDES. This also allows for later removal of SOC_FAMILY if desired as the only functional difference between both is now ironed out.

---
Changes for v5:
- Improve commit log (pb_)

 meta/classes/base.bbclass | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
meta/classes/base.bbclass +6 -5
index abd6a52..641316d 100644
@@ -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()
Signature · 1 line
1.8.1