summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Davies <charles.davies@whitetree.xyz>2021-02-18 20:52:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-15 14:49:09 +0000
commit5ec16c88fc0117cdfc72bcfcd5ffe8d16f580efa (patch)
tree4c4c3db899284fc8f1aa43f87b167e14a766dab9
parent27a7f3a35c1b0fed7a7f40b2b8431300c3f2ab78 (diff)
downloadpoky-5ec16c88fc0117cdfc72bcfcd5ffe8d16f580efa.tar.gz
multilib_global: handle REQUIRED_VERSION
Add logic to multilib_global.bbclass to handle new REQUIRED_VERSION variable. Fixes [YOCTO #10096] (From OE-Core rev: 05ba2df8e565589cf7b0b7cedcb96c7fdf97298b) Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/multilib_global.bbclass67
1 files changed, 38 insertions, 29 deletions
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
index 98f65c8aae..96257de5ca 100644
--- a/meta/classes/multilib_global.bbclass
+++ b/meta/classes/multilib_global.bbclass
@@ -1,6 +1,7 @@
1def preferred_ml_updates(d): 1def preferred_ml_updates(d):
2 # If any PREFERRED_PROVIDER or PREFERRED_VERSION are set, 2 # If any of PREFERRED_PROVIDER, PREFERRED_RPROVIDER, REQUIRED_VERSION
3 # we need to mirror these variables in the multilib case; 3 # or PREFERRED_VERSION are set, we need to mirror these variables in
4 # the multilib case;
4 multilibs = d.getVar('MULTILIBS') or "" 5 multilibs = d.getVar('MULTILIBS') or ""
5 if not multilibs: 6 if not multilibs:
6 return 7 return
@@ -11,43 +12,51 @@ def preferred_ml_updates(d):
11 if len(eext) > 1 and eext[0] == 'multilib': 12 if len(eext) > 1 and eext[0] == 'multilib':
12 prefixes.append(eext[1]) 13 prefixes.append(eext[1])
13 14
14 versions = [] 15 required_versions = []
16 preferred_versions = []
15 providers = [] 17 providers = []
16 rproviders = [] 18 rproviders = []
17 for v in d.keys(): 19 for v in d.keys():
20 if v.startswith("REQUIRED_VERSION_"):
21 required_versions.append(v)
18 if v.startswith("PREFERRED_VERSION_"): 22 if v.startswith("PREFERRED_VERSION_"):
19 versions.append(v) 23 preferred_versions.append(v)
20 if v.startswith("PREFERRED_PROVIDER_"): 24 if v.startswith("PREFERRED_PROVIDER_"):
21 providers.append(v) 25 providers.append(v)
22 if v.startswith("PREFERRED_RPROVIDER_"): 26 if v.startswith("PREFERRED_RPROVIDER_"):
23 rproviders.append(v) 27 rproviders.append(v)
24 28
25 for v in versions: 29 def sort_versions(versions, keyword):
26 val = d.getVar(v, False) 30 version_str = "_".join([keyword, "VERSION", ""])
27 pkg = v.replace("PREFERRED_VERSION_", "") 31 for v in versions:
28 if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")): 32 val = d.getVar(v, False)
29 continue 33 pkg = v.replace(version_str, "")
30 if '-cross-' in pkg and '${' in pkg: 34 if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")):
35 continue
36 if '-cross-' in pkg and '${' in pkg:
37 for p in prefixes:
38 localdata = bb.data.createCopy(d)
39 override = ":virtclass-multilib-" + p
40 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
41 if "-canadian-" in pkg:
42 newname = localdata.expand(v)
43 else:
44 newname = localdata.expand(v).replace(version_str, version_str + p + '-')
45 if newname != v:
46 newval = localdata.expand(val)
47 d.setVar(newname, newval)
48 # Avoid future variable key expansion
49 vexp = d.expand(v)
50 if v != vexp and d.getVar(v, False):
51 d.renameVar(v, vexp)
52 continue
31 for p in prefixes: 53 for p in prefixes:
32 localdata = bb.data.createCopy(d) 54 newname = version_str + p + "-" + pkg
33 override = ":virtclass-multilib-" + p 55 if not d.getVar(newname, False):
34 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override) 56 d.setVar(newname, val)
35 if "-canadian-" in pkg: 57
36 newname = localdata.expand(v) 58 sort_versions(required_versions, "REQUIRED")
37 else: 59 sort_versions(preferred_versions, "PREFERRED")
38 newname = localdata.expand(v).replace("PREFERRED_VERSION_", "PREFERRED_VERSION_" + p + '-')
39 if newname != v:
40 newval = localdata.expand(val)
41 d.setVar(newname, newval)
42 # Avoid future variable key expansion
43 vexp = d.expand(v)
44 if v != vexp and d.getVar(v, False):
45 d.renameVar(v, vexp)
46 continue
47 for p in prefixes:
48 newname = "PREFERRED_VERSION_" + p + "-" + pkg
49 if not d.getVar(newname, False):
50 d.setVar(newname, val)
51 60
52 for prov in providers: 61 for prov in providers:
53 val = d.getVar(prov, False) 62 val = d.getVar(prov, False)