[yocto] Dynamic PV version in recipe

Christopher Larson clarson at kergoth.com
Thu Jun 16 12:51:26 PDT 2016


On Thu, Jun 16, 2016 at 8:11 AM, Marco Garzola <marco.garzola at tecniplast.it>
wrote:

> I got a problem, maybe someone could help me.I have a recipe that takes
> from a jenkins server via json API a binary file with a version that i know
> only after do_compile task. the question is : is there any way to tell
> bitbake that $PV should change dynamically  , maybe in do_install task ? My
> goal is  to create the package with  the revision read from jenkins.


PV has to be set at parse time, up front, so bitbake can use it in stamps
to help determine when tasks need to be run, as well as including it in
WORKDIR and whatnot.

If all you want is to change the version in the emitted binary packages,
you can dynamically set PKGV, i.e. add a prefunc before do_package which
reads the PKGV. Of course, making sure it re-runs the appropriate tasks
when that value changes is rather less trivial, since bitbake generates
signatures/checksums at parse time.

Alternatively, would it be possible to contact the server via the json API
at parse time as long as BB_NO_NETWORK isn't set? Of course, unless there's
a way to support the BB_NO_NETWORK case, that would be problematic as well.
-- 
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.yoctoproject.org/pipermail/yocto/attachments/20160616/b9257a88/attachment.html>


More information about the yocto mailing list