All of lore.kernel.org
 help / color / mirror / Atom feed
* 'and' combination for OVERRIDES values?
@ 2017-04-13  0:16 Takashi Matsuzawa
  2017-04-13  5:23 ` Paul Eggleton
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Matsuzawa @ 2017-04-13  0:16 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

Hello, Yocto.

I just wonder if there is convenient way of defining somthing in recipes based on combination of two OVERRIDES variables.
Say, I have two variables xxx and yyy.

AAA = "false"
AAA_xxx = "true"
AAA_yyy = "true"

But what if I want to set AAA to be "true" only when xxx and yyy are in OVERRIDES?
(And also for 'or' condition.)

The similar situation for do_install_append(), etc.

do_install_append_xxx() {
}

do_install_append_yyy() {
}



[-- Attachment #2: Type: text/html, Size: 1166 bytes --]

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

* Re: 'and' combination for OVERRIDES values?
  2017-04-13  0:16 'and' combination for OVERRIDES values? Takashi Matsuzawa
@ 2017-04-13  5:23 ` Paul Eggleton
  2017-04-13  5:35   ` Takashi Matsuzawa
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2017-04-13  5:23 UTC (permalink / raw)
  To: Takashi Matsuzawa; +Cc: yocto

On Thursday, 13 April 2017 12:16:08 PM NZST Takashi Matsuzawa wrote:
> I just wonder if there is convenient way of defining somthing in recipes
> based on combination of two OVERRIDES variables. Say, I have two variables
> xxx and yyy.
> 
> AAA = "false"
> AAA_xxx = "true"
> AAA_yyy = "true"
> 
> But what if I want to set AAA to be "true" only when xxx and yyy are in
> OVERRIDES? (And also for 'or' condition.)

This should work for "and":

AAA_xxx_yyy = "true"

(There was a time many releases ago where this didn't, but it should work in 
any release in the last few years).

For "or" you already have the answer above, basically do it with the same 
value for both overrides:

AAA = "false"
AAA_xxx = "true"
AAA_yyy = "true"
 
> The similar situation for do_install_append(), etc.
> 
> do_install_append_xxx() {
> }
> 
> do_install_append_yyy() {
> }

Same thing - for and:

do_install_append_xxx_yyy() {
}

for or:

do_install_append_xxx() {
}
 
do_install_append_yyy() {
}

Note, we're appending here rather than setting as above, but otherwise setting 
a function is pretty much the same in terms of operations as a variable - the 
syntax is slightly different and immediate operations (such as +=) aren't 
allowed, but the same rules apply for overrides and deferred operations such 
as _append.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: 'and' combination for OVERRIDES values?
  2017-04-13  5:23 ` Paul Eggleton
@ 2017-04-13  5:35   ` Takashi Matsuzawa
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Matsuzawa @ 2017-04-13  5:35 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1779 bytes --]

Hello.


>AAA_xxx_yyy = "true"

Thank you, I will try.  I could not figure out but I feel it should work.

________________________________
From: Paul Eggleton <paul.eggleton@linux.intel.com>
Sent: Thursday, April 13, 2017 2:23 PM
To: Takashi Matsuzawa
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] 'and' combination for OVERRIDES values?

On Thursday, 13 April 2017 12:16:08 PM NZST Takashi Matsuzawa wrote:
> I just wonder if there is convenient way of defining somthing in recipes
> based on combination of two OVERRIDES variables. Say, I have two variables
> xxx and yyy.
>
> AAA = "false"
> AAA_xxx = "true"
> AAA_yyy = "true"
>
> But what if I want to set AAA to be "true" only when xxx and yyy are in
> OVERRIDES? (And also for 'or' condition.)

This should work for "and":

AAA_xxx_yyy = "true"

(There was a time many releases ago where this didn't, but it should work in
any release in the last few years).

For "or" you already have the answer above, basically do it with the same
value for both overrides:

AAA = "false"
AAA_xxx = "true"
AAA_yyy = "true"

> The similar situation for do_install_append(), etc.
>
> do_install_append_xxx() {
> }
>
> do_install_append_yyy() {
> }

Same thing - for and:

do_install_append_xxx_yyy() {
}

for or:

do_install_append_xxx() {
}

do_install_append_yyy() {
}

Note, we're appending here rather than setting as above, but otherwise setting
a function is pretty much the same in terms of operations as a variable - the
syntax is slightly different and immediate operations (such as +=) aren't
allowed, but the same rules apply for overrides and deferred operations such
as _append.

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

[-- Attachment #2: Type: text/html, Size: 3258 bytes --]

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

end of thread, other threads:[~2017-04-13  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13  0:16 'and' combination for OVERRIDES values? Takashi Matsuzawa
2017-04-13  5:23 ` Paul Eggleton
2017-04-13  5:35   ` Takashi Matsuzawa

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.