summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-11-18 20:12:49 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-13 23:02:49 +0000
commit001c21e32e9bdad57a5b092bc81bdbb652ba4fe4 (patch)
tree872373219ee472880437fcb879cce772d5b8bc24 /meta/classes
parente873b3ba278f7edeb60300a31d5c8a9c289b5a48 (diff)
downloadpoky-001c21e32e9bdad57a5b092bc81bdbb652ba4fe4.tar.gz
classes/crate-fetch: Ensure crate fetcher is available
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: 19577427d25739588fdf607b6e3905dddfe206ff) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bc66c5dd65fb654af5cd91b47f9b4f7a5f53436e) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/crate-fetch.bbclass21
1 files changed, 18 insertions, 3 deletions
diff --git a/meta/classes/crate-fetch.bbclass b/meta/classes/crate-fetch.bbclass
index c0ed434a96..a7fa22b2a0 100644
--- a/meta/classes/crate-fetch.bbclass
+++ b/meta/classes/crate-fetch.bbclass
@@ -7,7 +7,22 @@
7# crate://<packagename>/<version> 7# crate://<packagename>/<version>
8# 8#
9 9
10python () { 10def import_crate(d):
11 import crate 11 import crate
12 bb.fetch2.methods.append( crate.Crate() ) 12 if not getattr(crate, 'imported', False):
13 bb.fetch2.methods.append(crate.Crate())
14 crate.imported = True
15
16python crate_import_handler() {
17 import_crate(d)
13} 18}
19
20addhandler crate_import_handler
21crate_import_handler[eventmask] = "bb.event.RecipePreFinalise"
22
23def crate_get_srcrev(d):
24 import_crate(d)
25 return bb.fetch2.get_srcrev(d)
26
27# Override SRCPV to make sure it imports the fetcher first
28SRCPV = "${@crate_get_srcrev(d)}"