* require/include a .bb file in the same directory?
@ 2012-03-30 9:59 Robert P. J. Day
2012-03-30 19:50 ` Denys Dmytriyenko
0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2012-03-30 9:59 UTC (permalink / raw)
To: OE Core mailing list
couple questions about the require/include directives. first, can
you include *any* valid text file? not just your standard .inc file
(even though that is of course the most common thing to do).
and second, i'm looking at this example in meta/recipes-core/images,
where the recipe file core-image-minimal-mtdutils.bb is defined as:
require core-image-minimal.bb
IMAGE_INSTALL += "mtd-utils"
that looks perfectly reasonable since that required .bb file is in the
same directory, and this is clearly just defining a new image recipe
by adding one more package.
but the explanation of include/require in the bitbake manual is:
"if the path specified on the include line is a relative path,
BitBake will locate the first one it can find within BBPATH."
that suggests that, by some massively unlikely fluke, i might
unknowingly have an identically-named recipe file earlier in my BBPATH
variable and that earlier one is the one that would be included. is
that correct?
and if that's true, could i avoid that kind of mistake by doing:
require ./core-image-minimal.bb
i realize getting hung up like this is unlikely, but it's always
possible.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: require/include a .bb file in the same directory?
2012-03-30 9:59 require/include a .bb file in the same directory? Robert P. J. Day
@ 2012-03-30 19:50 ` Denys Dmytriyenko
2012-03-30 19:54 ` Chris Larson
0 siblings, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2012-03-30 19:50 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Fri, Mar 30, 2012 at 05:59:22AM -0400, Robert P. J. Day wrote:
>
> couple questions about the require/include directives. first, can
> you include *any* valid text file? not just your standard .inc file
> (even though that is of course the most common thing to do).
>
> and second, i'm looking at this example in meta/recipes-core/images,
> where the recipe file core-image-minimal-mtdutils.bb is defined as:
>
> require core-image-minimal.bb
> IMAGE_INSTALL += "mtd-utils"
>
> that looks perfectly reasonable since that required .bb file is in the
> same directory, and this is clearly just defining a new image recipe
> by adding one more package.
>
> but the explanation of include/require in the bitbake manual is:
>
> "if the path specified on the include line is a relative path,
> BitBake will locate the first one it can find within BBPATH."
>
> that suggests that, by some massively unlikely fluke, i might
> unknowingly have an identically-named recipe file earlier in my BBPATH
> variable and that earlier one is the one that would be included. is
> that correct?
For that to happen, the file has to be in the top-level directory of one of
your layers listed by BBPATH, which rarely happens, as proper layers have at
least a minimal directory structure, such as conf/, recipes/ etc.
On the other hand, if you really want that file to be included from another
layer, which is higher priority or listed earlier, then you would need to do:
require recipes-core/images/core-image-minimal.bb
> and if that's true, could i avoid that kind of mistake by doing:
>
> require ./core-image-minimal.bb
I haven't tried that, but I believe it will be the same as w/o ./
> i realize getting hung up like this is unlikely, but it's always
> possible.
--
Denys
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: require/include a .bb file in the same directory?
2012-03-30 19:50 ` Denys Dmytriyenko
@ 2012-03-30 19:54 ` Chris Larson
2012-03-30 20:20 ` Robert P. J. Day
0 siblings, 1 reply; 4+ messages in thread
From: Chris Larson @ 2012-03-30 19:54 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Fri, Mar 30, 2012 at 12:50 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> On Fri, Mar 30, 2012 at 05:59:22AM -0400, Robert P. J. Day wrote:
>>
>> couple questions about the require/include directives. first, can
>> you include *any* valid text file? not just your standard .inc file
>> (even though that is of course the most common thing to do).
>>
>> and second, i'm looking at this example in meta/recipes-core/images,
>> where the recipe file core-image-minimal-mtdutils.bb is defined as:
>>
>> require core-image-minimal.bb
>> IMAGE_INSTALL += "mtd-utils"
>>
>> that looks perfectly reasonable since that required .bb file is in the
>> same directory, and this is clearly just defining a new image recipe
>> by adding one more package.
>>
>> but the explanation of include/require in the bitbake manual is:
>>
>> "if the path specified on the include line is a relative path,
>> BitBake will locate the first one it can find within BBPATH."
>>
>> that suggests that, by some massively unlikely fluke, i might
>> unknowingly have an identically-named recipe file earlier in my BBPATH
>> variable and that earlier one is the one that would be included. is
>> that correct?
The directory the recipe lives in gets temporarily injected into
BBPATH as the first element.
--
Christopher Larson
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: require/include a .bb file in the same directory?
2012-03-30 19:54 ` Chris Larson
@ 2012-03-30 20:20 ` Robert P. J. Day
0 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2012-03-30 20:20 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Fri, 30 Mar 2012, Chris Larson wrote:
... snip ...
> The directory the recipe lives in gets temporarily injected into
> BBPATH as the first element.
ah, that wasn't at all obvious, until i dumped the bitbake
environment with "bitbake -e" and noticed:
BBPATH=":/home/rpjday/oe/oe-core/meta"
is the null entry at the front of BBPATH supposed to represent the
current directory, just like it would with PATH?
rday
p.s. is this property mentioned anywhere in the bitbake manual? it's
definitely useful to know.
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-30 20:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 9:59 require/include a .bb file in the same directory? Robert P. J. Day
2012-03-30 19:50 ` Denys Dmytriyenko
2012-03-30 19:54 ` Chris Larson
2012-03-30 20:20 ` Robert P. J. Day
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.