Date
1 - 3 of 3
Possible to ignore a missing file in recipe without error?
Howard
Hi:
I have a simple recipe that installs a few miscellaneous files, one of the files may or may not be present and in reality that's ok for the moment, but I don't see a way to do things in a recipe based on the presence or absence of a file. For example: LICENSE="CLOSED" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" # always present file SRC_URI += "file://myconfig.config" # sometimes present file - is there a way to conditionally do this statement SRC_URI += "file://myOtherConfig.config" do_install() { install -d ${D}${sysconfdir} install -m 0755 ${WORKDIR}/myconfig.config ${D}${sysconfdir} #same here install -m 0755 ${WORKDIR}/myOtherConfig.config ${D}${sysconfdir} } FILES_${PN} += " ${sysconfdir}/myconfig.config " #same here FILES_${PN} += " ${sysconfdir}/myOtherConfig.config " Many thanks Howard
|
|
Josef Holzmayr
Howdy!
The real question is: what is the condition? It must be something that is constant across all of the build. And if can only come from either a .conf file or the environment, otherwise it would not be visible in the recipe.
A possible approach would be only appending depending on a specific DISTRO_FLAG, via bb.utils.contains. I have done something similar at https://github.com/TheYoctoJester/meta-zinc/blob/5c566c2f7d29d9db15db0c70cd3dd79fa755c351/recipes-zinc/libanswer/libanswer_git.bb#L26 But again, it depends on the exact use case. Greetz
|
|
Howard
Thanks Josef, that sounds like what I want to do isn't really possible Or if it is, it isn't worth the effort.
|
|