summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/devupstream.bbclass20
1 files changed, 13 insertions, 7 deletions
diff --git a/meta/classes/devupstream.bbclass b/meta/classes/devupstream.bbclass
index 1230fa12ea..dc9a9472b1 100644
--- a/meta/classes/devupstream.bbclass
+++ b/meta/classes/devupstream.bbclass
@@ -16,8 +16,6 @@
16# - If the fetcher requires native tools (such as subversion-native) then 16# - If the fetcher requires native tools (such as subversion-native) then
17# bitbake won't be able to add them automatically. 17# bitbake won't be able to add them automatically.
18 18
19CLASSOVERRIDE .= ":class-devupstream"
20
21python devupstream_virtclass_handler () { 19python devupstream_virtclass_handler () {
22 # Do nothing if this is inherited, as it's for BBCLASSEXTEND 20 # Do nothing if this is inherited, as it's for BBCLASSEXTEND
23 if "devupstream" not in (d.getVar('BBCLASSEXTEND') or ""): 21 if "devupstream" not in (d.getVar('BBCLASSEXTEND') or ""):
@@ -25,8 +23,8 @@ python devupstream_virtclass_handler () {
25 return 23 return
26 24
27 variant = d.getVar("BBEXTENDVARIANT") 25 variant = d.getVar("BBEXTENDVARIANT")
28 if variant not in ("target"): 26 if variant not in ("target", "native"):
29 bb.error("Pass the variant when using devupstream, for example devupstream:target") 27 bb.error("Unsupported variant %s. Pass the variant when using devupstream, for example devupstream:target" % variant)
30 return 28 return
31 29
32 # Develpment releases are never preferred by default 30 # Develpment releases are never preferred by default
@@ -34,14 +32,22 @@ python devupstream_virtclass_handler () {
34 32
35 uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0]) 33 uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0])
36 34
37 if uri.scheme == "git": 35 if uri.scheme == "git" and not d.getVar("S:class-devupstream"):
38 d.setVar("S", "${WORKDIR}/git") 36 d.setVar("S:class-devupstream", "${WORKDIR}/git")
39 37
40 # Modify the PV if the recipe hasn't already overridden it 38 # Modify the PV if the recipe hasn't already overridden it
41 pv = d.getVar("PV") 39 pv = d.getVar("PV")
42 proto_marker = "+" + uri.scheme 40 proto_marker = "+" + uri.scheme
43 if proto_marker not in pv: 41 if proto_marker not in pv and not d.getVar("PV:class-devupstream"):
44 d.setVar("PV", pv + proto_marker + "${SRCPV}") 42 d.setVar("PV", pv + proto_marker + "${SRCPV}")
43
44 if variant == "native":
45 pn = d.getVar("PN")
46 d.setVar("PN", "%s-native" % (pn))
47 fn = d.getVar("FILE")
48 bb.parse.BBHandler.inherit("native", fn, 0, d)
49
50 d.appendVar("CLASSOVERRIDE", ":class-devupstream")
45} 51}
46 52
47addhandler devupstream_virtclass_handler 53addhandler devupstream_virtclass_handler