All of lore.kernel.org
 help / color / mirror / Atom feed
* Forcing a task to run depending on the output of a python script?
@ 2018-05-10 19:25 Becker Béla
  2018-05-15 13:11 ` Becker Béla
  0 siblings, 1 reply; 2+ messages in thread
From: Becker Béla @ 2018-05-10 19:25 UTC (permalink / raw)
  To: bitbake-devel

My goal is to have a fancy version string, computed from my meta layer using versions of the `git describe` command, to be stored in the file system, but I can't figure out how I can invalidate the cache for my recipe in order for the do_install task to fire.

Currently, I'm using an anonymous python script instide a .bbclass to set up a variable ( let's call it ${VERSION} ) using git's numerous commands. This is then inherited in a .bb file, that contains a single file for the target, under /etc with my fancy string.

When I run `bitbake -e git-version`, I can see that leaving a commit changes the variable, but the package isn't rebuilt, not until I force it.

So far I have tried:
-setting `PV = ${VERSION}`
-changing the task basehash with `BB_BASEHASH_task-do_install += ${VERSION}`
-adding VERSION to do_install[vardeps]

Is it possible, to have this package be rebuilt when a change occurs, so the images will be rebuilt as well?


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

* Re: Forcing a task to run depending on the output of a python script?
  2018-05-10 19:25 Forcing a task to run depending on the output of a python script? Becker Béla
@ 2018-05-15 13:11 ` Becker Béla
  0 siblings, 0 replies; 2+ messages in thread
From: Becker Béla @ 2018-05-15 13:11 UTC (permalink / raw)
  To: bitbake-devel

Replying to myself because I figured it out.

If you ever need such functionality, just add a git type SRC_REV pointing to your local repo with the "usehead" option set, and use AUTOREV.

e.g.
    SRC_URI = "git://${THISDIR}/../..;usehead=1;bareclone=1"
    SRCREV = "${AUTOREV}"

"${THISDIR}/../.." looks dirty, but unfortunately ${LAYERDIR} is unavailable outside layer.conf

Cheers to everyone. I hope somebody will find this useful.




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

end of thread, other threads:[~2018-05-15 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-10 19:25 Forcing a task to run depending on the output of a python script? Becker Béla
2018-05-15 13:11 ` Becker Béla

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.