All of lore.kernel.org
 help / color / mirror / Atom feed
* more nitpickery: difference between d.getVar() and d.expand()?
@ 2020-05-05 13:27 Robert P. J. Day
  2020-05-19 10:58 ` [bitbake-devel] " Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2020-05-05 13:27 UTC (permalink / raw)
  To: BitBake developer list


  no, wait, hear me out :-). still crawling through BB user manual,
section 3.5.2, talks about using d.getVar("X") "or for more
complicated expressions, use d.expand()".

  fair enough, but it seems like a lot of the code bounces back and
forth when getting the value of a simple variable, as in:

  libdir = d.getVar("libdir")
  libdir = d.expand("${libdir}")

given that d.getVar() by default expands the value, is there some
difference between the two statements above when specifically
accessing a single variable in the data dictionary?

rday

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

* Re: [bitbake-devel] more nitpickery: difference between d.getVar() and d.expand()?
  2020-05-05 13:27 more nitpickery: difference between d.getVar() and d.expand()? Robert P. J. Day
@ 2020-05-19 10:58 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2020-05-19 10:58 UTC (permalink / raw)
  To: bitbake-devel

On Tue, 2020-05-05 at 09:27 -0400, Robert P. J. Day wrote:
>   no, wait, hear me out :-). still crawling through BB user manual,
> section 3.5.2, talks about using d.getVar("X") "or for more
> complicated expressions, use d.expand()".
> 
>   fair enough, but it seems like a lot of the code bounces back and
> forth when getting the value of a simple variable, as in:
> 
>   libdir = d.getVar("libdir")
>   libdir = d.expand("${libdir}")
> 
> given that d.getVar() by default expands the value, is there some
> difference between the two statements above when specifically
> accessing a single variable in the data dictionary?

No, there is no difference. I'd usually suggest getVar for a single
variable and expand for an expression.

Cheers,

Richard


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

end of thread, other threads:[~2020-05-19 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 13:27 more nitpickery: difference between d.getVar() and d.expand()? Robert P. J. Day
2020-05-19 10:58 ` [bitbake-devel] " Richard Purdie

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.