[OE-core] [RFC 1/2] os-release: add new operating system identification recipe

Chris Larson kergoth at gmail.com
Fri Dec 13 15:18:18 UTC 2013


On Fri, Dec 13, 2013 at 8:12 AM, Chris Larson <kergoth at gmail.com> wrote:

> On Fri, Dec 13, 2013 at 8:08 AM, Martin Jansa <martin.jansa at gmail.com>wrote:
>
>> > +do_compile () {
>> > +    for field in ${OS_RELEASE_FIELDS}; do
>> > +        if eval "test -n \"\$$field\""; then
>> > +            eval "printf \"%s=%s\n\" \"\$field\" \"\$$field\""
>> > +        fi
>> > +    done >os-release
>> > +}
>> > +do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
>>
>> Isn't this dependency picked automatically?
>>
>
> No, this is expanded, so this adds the dependency on the variables whose
> names are in the OS_RELEASE_FIELDS variable, not just on OS_RELEASE_FIELDS
> itself. Due to the use of eval, bitbake doesn’t know we’re using the
> iterated values as variable names.


To put it perhaps more clearly and succinctly, do_compile[vardeps] +=
“OS_RELEASE_FIELDS” would be unnecessary, do_compile[vardeps] +=
“${OS_RELEASE_FIELDS}” isn’t :)
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20131213/984a757d/attachment-0002.html>


More information about the Openembedded-core mailing list