All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
@ 2013-04-08 20:58 Otavio Salvador
  2013-04-08 21:29 ` Otavio Salvador
  2013-04-08 21:31 ` Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Otavio Salvador @ 2013-04-08 20:58 UTC (permalink / raw)
  To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador

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.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes for v3:
- Stop checking for SOC_FAMILY as it is just for compatibility with
  old BSPs; we move to MACHINEOVERRIDES for this case (RP)

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

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index abd6a52..313359c 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.extend((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()
-- 
1.8.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
  2013-04-08 20:58 [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE Otavio Salvador
@ 2013-04-08 21:29 ` Otavio Salvador
  2013-04-08 21:31 ` Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2013-04-08 21:29 UTC (permalink / raw)
  To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador

On Mon, Apr 8, 2013 at 5:58 PM, Otavio Salvador <otavio@ossystems.com.br> wrote:
> 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.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
...
> +            compat_machines.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))
...

I did run it and it fails. I am fixing it and will send a new  version
well tested.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
  2013-04-08 20:58 [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE Otavio Salvador
  2013-04-08 21:29 ` Otavio Salvador
@ 2013-04-08 21:31 ` Richard Purdie
  2013-04-08 21:33   ` Otavio Salvador
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2013-04-08 21:31 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List

On Mon, 2013-04-08 at 17:58 -0300, Otavio Salvador wrote:
> 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.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes for v3:
> - Stop checking for SOC_FAMILY as it is just for compatibility with
>   old BSPs; we move to MACHINEOVERRIDES for this case (RP)
> 
>  meta/classes/base.bbclass | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index abd6a52..313359c 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.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))

No variable "compat_machines" exists before this line so this patch
cannot possibly work. What did you test?

We're close to release and I'm getting pushed hard in places like IRC to
take patches like this which clearly don't work :(

I'm not happy.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE
  2013-04-08 21:31 ` Richard Purdie
@ 2013-04-08 21:33   ` Otavio Salvador
  0 siblings, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2013-04-08 21:33 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OpenEmbedded Core Mailing List

On Mon, Apr 8, 2013 at 6:31 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2013-04-08 at 17:58 -0300, Otavio Salvador wrote:
>> 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.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>> Changes for v3:
>> - Stop checking for SOC_FAMILY as it is just for compatibility with
>>   old BSPs; we move to MACHINEOVERRIDES for this case (RP)
>>
>>  meta/classes/base.bbclass | 11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>> index abd6a52..313359c 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.extend((d.getVar('MACHINEOVERRIDES', True) or "").split(":"))
>
> No variable "compat_machines" exists before this line so this patch
> cannot possibly work. What did you test?

I got it when testing, hence my previous e-mail saying I found a problem.

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-08 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-08 20:58 [PATCH v3] base.bbclass: Fix matching of MACHINEOVERRIDES in COMPATIBLE_MACHINE Otavio Salvador
2013-04-08 21:29 ` Otavio Salvador
2013-04-08 21:31 ` Richard Purdie
2013-04-08 21:33   ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.