* [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
@ 2013-04-06 17:17 Otavio Salvador
2013-04-06 18:02 ` Eric Bénard
0 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2013-04-06 17:17 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador
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>
---
meta/classes/base.bbclass | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index abd6a52..6f24064 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -515,11 +515,13 @@ 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('MACHINE', True)]
+ compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
+ for this_machine in compat_machines:
+ if re.match(need_machine, this_machine):
+ 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()
--
1.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-06 17:17 [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE Otavio Salvador
@ 2013-04-06 18:02 ` Eric Bénard
2013-04-06 20:58 ` Otavio Salvador
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2013-04-06 18:02 UTC (permalink / raw)
To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List
Hi Otavio,
Le Sat, 6 Apr 2013 14:17:48 -0300,
Otavio Salvador <otavio@ossystems.com.br> a écrit :
> 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>
> ---
> meta/classes/base.bbclass | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index abd6a52..6f24064 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -515,11 +515,13 @@ 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('MACHINE', True)]
> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
> + for this_machine in compat_machines:
> + if re.match(need_machine, this_machine):
> + break
> + else:
> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
>
aren't you breaking this log here vs what is was supposed to
print before ?
Eric
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-06 18:02 ` Eric Bénard
@ 2013-04-06 20:58 ` Otavio Salvador
2013-04-07 5:37 ` Eric Bénard
0 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2013-04-06 20:58 UTC (permalink / raw)
To: Eric Bénard; +Cc: OpenEmbedded Core Mailing List
On Sat, Apr 6, 2013 at 3:02 PM, Eric Bénard <eric@eukrea.com> wrote:
> Hi Otavio,
>
> Le Sat, 6 Apr 2013 14:17:48 -0300,
> Otavio Salvador <otavio@ossystems.com.br> a écrit :
>
>> 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>
>> ---
>> meta/classes/base.bbclass | 12 +++++++-----
>> 1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>> index abd6a52..6f24064 100644
>> --- a/meta/classes/base.bbclass
>> +++ b/meta/classes/base.bbclass
>> @@ -515,11 +515,13 @@ 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('MACHINE', True)]
>> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
>> + for this_machine in compat_machines:
>> + if re.match(need_machine, this_machine):
>> + break
>> + else:
>> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
>>
> aren't you breaking this log here vs what is was supposed to
> print before ?
The 'else' is used when no 'break' is done inside of for loop.
--
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] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-06 20:58 ` Otavio Salvador
@ 2013-04-07 5:37 ` Eric Bénard
2013-04-08 13:31 ` Otavio Salvador
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2013-04-07 5:37 UTC (permalink / raw)
To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List
Le Sat, 6 Apr 2013 17:58:30 -0300,
Otavio Salvador <otavio@ossystems.com.br> a écrit :
> On Sat, Apr 6, 2013 at 3:02 PM, Eric Bénard <eric@eukrea.com> wrote:
> > Hi Otavio,
> >
> > Le Sat, 6 Apr 2013 14:17:48 -0300,
> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
> >
> >> 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>
> >> ---
> >> meta/classes/base.bbclass | 12 +++++++-----
> >> 1 file changed, 7 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> >> index abd6a52..6f24064 100644
> >> --- a/meta/classes/base.bbclass
> >> +++ b/meta/classes/base.bbclass
> >> @@ -515,11 +515,13 @@ 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('MACHINE', True)]
> >> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
> >> + for this_machine in compat_machines:
> >> + if re.match(need_machine, this_machine):
> >> + break
> >> + else:
> >> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
> >>
> > aren't you breaking this log here vs what is was supposed to
> > print before ?
>
> The 'else' is used when no 'break' is done inside of for loop.
>
but will this_machine contain the value of the MACHINE variable ?
Eric
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-07 5:37 ` Eric Bénard
@ 2013-04-08 13:31 ` Otavio Salvador
2013-04-08 13:37 ` Eric Bénard
0 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2013-04-08 13:31 UTC (permalink / raw)
To: Eric Bénard; +Cc: OpenEmbedded Core Mailing List
On Sun, Apr 7, 2013 at 2:37 AM, Eric Bénard <eric@eukrea.com> wrote:
> Le Sat, 6 Apr 2013 17:58:30 -0300,
> Otavio Salvador <otavio@ossystems.com.br> a écrit :
>
>> On Sat, Apr 6, 2013 at 3:02 PM, Eric Bénard <eric@eukrea.com> wrote:
>> > Hi Otavio,
>> >
>> > Le Sat, 6 Apr 2013 14:17:48 -0300,
>> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
>> >
>> >> 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>
>> >> ---
>> >> meta/classes/base.bbclass | 12 +++++++-----
>> >> 1 file changed, 7 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>> >> index abd6a52..6f24064 100644
>> >> --- a/meta/classes/base.bbclass
>> >> +++ b/meta/classes/base.bbclass
>> >> @@ -515,11 +515,13 @@ 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('MACHINE', True)]
>> >> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
>> >> + for this_machine in compat_machines:
>> >> + if re.match(need_machine, this_machine):
>> >> + break
>> >> + else:
>> >> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
>> >>
>> > aren't you breaking this log here vs what is was supposed to
>> > print before ?
>>
>> The 'else' is used when no 'break' is done inside of for loop.
>>
> but will this_machine contain the value of the MACHINE variable ?
Yes, check:
...
+ compat_machines = [d.getVar('MACHINE', True)]
+ compat_machines.extend((d.getVar('SOC_FAMILY', True) or
"").split(":"))
...
--
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] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-08 13:31 ` Otavio Salvador
@ 2013-04-08 13:37 ` Eric Bénard
2013-04-08 13:44 ` Otavio Salvador
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2013-04-08 13:37 UTC (permalink / raw)
To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List
Hi Otavio,
Le Mon, 8 Apr 2013 10:31:17 -0300,
Otavio Salvador <otavio@ossystems.com.br> a écrit :
> On Sun, Apr 7, 2013 at 2:37 AM, Eric Bénard <eric@eukrea.com> wrote:
> > Le Sat, 6 Apr 2013 17:58:30 -0300,
> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
> >
> >> On Sat, Apr 6, 2013 at 3:02 PM, Eric Bénard <eric@eukrea.com> wrote:
> >> > Hi Otavio,
> >> >
> >> > Le Sat, 6 Apr 2013 14:17:48 -0300,
> >> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
> >> >> + compat_machines = [d.getVar('MACHINE', True)]
> >> >> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
> >> >> + for this_machine in compat_machines:
> >> >> + if re.match(need_machine, this_machine):
> >> >> + break
> >> >> + else:
> >> >> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
> >> >>
> >> > aren't you breaking this log here vs what is was supposed to
> >> > print before ?
> >>
> >> The 'else' is used when no 'break' is done inside of for loop.
> >>
> > but will this_machine contain the value of the MACHINE variable ?
>
> Yes, check:
>
> ...
> + compat_machines = [d.getVar('MACHINE', True)]
> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or
> "").split(":"))
> ...
>
I'm not very experienced in python so sorry is that's a stupid
remark but after these lines you are using this_machine to go
through the content of compat_machines so in the end, when it reach the
log message it will contain the last value in compat_machine (and thus
the last one in SOC_FAMILY instead of the machine name) ?
Eric
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE
2013-04-08 13:37 ` Eric Bénard
@ 2013-04-08 13:44 ` Otavio Salvador
0 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2013-04-08 13:44 UTC (permalink / raw)
To: Eric Bénard; +Cc: OpenEmbedded Core Mailing List
On Mon, Apr 8, 2013 at 10:37 AM, Eric Bénard <eric@eukrea.com> wrote:
> Hi Otavio,
>
> Le Mon, 8 Apr 2013 10:31:17 -0300,
> Otavio Salvador <otavio@ossystems.com.br> a écrit :
>
>> On Sun, Apr 7, 2013 at 2:37 AM, Eric Bénard <eric@eukrea.com> wrote:
>> > Le Sat, 6 Apr 2013 17:58:30 -0300,
>> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
>> >
>> >> On Sat, Apr 6, 2013 at 3:02 PM, Eric Bénard <eric@eukrea.com> wrote:
>> >> > Hi Otavio,
>> >> >
>> >> > Le Sat, 6 Apr 2013 14:17:48 -0300,
>> >> > Otavio Salvador <otavio@ossystems.com.br> a écrit :
>> >> >> + compat_machines = [d.getVar('MACHINE', True)]
>> >> >> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or "").split(":"))
>> >> >> + for this_machine in compat_machines:
>> >> >> + if re.match(need_machine, this_machine):
>> >> >> + break
>> >> >> + else:
>> >> >> + raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % this_machine)
>> >> >>
>> >> > aren't you breaking this log here vs what is was supposed to
>> >> > print before ?
>> >>
>> >> The 'else' is used when no 'break' is done inside of for loop.
>> >>
>> > but will this_machine contain the value of the MACHINE variable ?
>>
>> Yes, check:
>>
>> ...
>> + compat_machines = [d.getVar('MACHINE', True)]
>> + compat_machines.extend((d.getVar('SOC_FAMILY', True) or
>> "").split(":"))
>> ...
>>
> I'm not very experienced in python so sorry is that's a stupid
> remark but after these lines you are using this_machine to go
> through the content of compat_machines so in the end, when it reach the
> log message it will contain the last value in compat_machine (and thus
> the last one in SOC_FAMILY instead of the machine name) ?
Indeed this is indeed a bug. I will follow-up with a proper fix for it.
--
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] 7+ messages in thread
end of thread, other threads:[~2013-04-08 14:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 17:17 [PATCH] base.bbclass: Fix matching of SOC_FAMILY in COMPATIBLE_MACHINE Otavio Salvador
2013-04-06 18:02 ` Eric Bénard
2013-04-06 20:58 ` Otavio Salvador
2013-04-07 5:37 ` Eric Bénard
2013-04-08 13:31 ` Otavio Salvador
2013-04-08 13:37 ` Eric Bénard
2013-04-08 13:44 ` 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.