The "file-checksums" varflag and how to set it using bb.fetch.get_checksum_file_list should get documented. Together they solve the problem of "a task depends on certain files (regardless whether they exist at the moment or not)".
bb.fetch.get_checksum_file_list() is specific to SRC_URI. It merely shows the expected content of file-checksums. I found that I needed an utility method: fakeroot do_ostree_prepare_rootfs () { ... ${FLATPAKBASE}/scripts/gpg-keygen.sh ... ... ${META_REFKIT_CORE_BASE}/scripts/mk-ostree.sh ... } def get_file_list(filenames): filelist = [] for filename in filenames: filelist.append(filename + ":" + str(os.path.exists(filename))) return ' '.join(filelist) do_ostree_prepare_rootfs[file-checksums] += "${@get_file_list(( \ '${META_REFKIT_CORE_BASE}/scripts/mk-ostree.sh', \ '${FLATPAKBASE}/scripts/gpg-keygen.sh', \ ))}" Note that files moving around is covered by the vardep on FLATPAKBASE and META_REFKIT_CORE_BASE in do_ostree_prepare_rootfs. I'm not sure whether some example like this would be useful for the documentation, and whether get_file_list() should be in bitbake itself (where, under which name?). Suggestions welcome...
Could I get link to some other document according to which I need to document all the things which are mentioned in above example or is there some template for the same?
Notes: The varflag [file-checksums] should be documented in section 3.7 of the Bitbake documentation As inferred by OP the list is derived from bitbake's bb.fetch.get_checksum_file_list which is an internal function. I think that given the current depth of explanations in section 3.7 make inline examples out of scope. However I see the value in it but it needs to be a reproducible example without extensive dependencies.
Patch has been accepted to docs repository.
Bulk move from 4.99 or 0.00 to 5.99
Antonin to check if resolved.
Now documented by commit https://git.yoctoproject.org/poky/commit/?id=d86cbd3d3d9d2565cd29abd5698243781623185e Moving to Resolved fixed