mirror of
https://git.yoctoproject.org/poky
synced 2026-02-08 18:02:12 +01:00
Reworks the crate fetcher class to have it install the fetcher at recipe finalization so that it is always available before SRC_URI is expanded. In addition, override the value of SRCPV to also install the fetcher when SRCPV is expanded so that AUTOREV works. [YOCTO #10867] (From OE-Core rev: bc66c5dd65fb654af5cd91b47f9b4f7a5f53436e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
29 lines
653 B
Plaintext
29 lines
653 B
Plaintext
#
|
|
# crate-fetch class
|
|
#
|
|
# Registers 'crate' method for Bitbake fetch2.
|
|
#
|
|
# Adds support for following format in recipe SRC_URI:
|
|
# crate://<packagename>/<version>
|
|
#
|
|
|
|
def import_crate(d):
|
|
import crate
|
|
if not getattr(crate, 'imported', False):
|
|
bb.fetch2.methods.append(crate.Crate())
|
|
crate.imported = True
|
|
|
|
python crate_import_handler() {
|
|
import_crate(d)
|
|
}
|
|
|
|
addhandler crate_import_handler
|
|
crate_import_handler[eventmask] = "bb.event.RecipePreFinalise"
|
|
|
|
def crate_get_srcrev(d):
|
|
import_crate(d)
|
|
return bb.fetch2.get_srcrev(d)
|
|
|
|
# Override SRCPV to make sure it imports the fetcher first
|
|
SRCPV = "${@crate_get_srcrev(d)}"
|