diff options
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index ff960cd0e3..e686652f16 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -139,6 +139,50 @@ def pkgarch_mapping(d): | |||
139 | if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon": | 139 | if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon": |
140 | d.setVar("TUNE_PKGARCH", "armv7a") | 140 | d.setVar("TUNE_PKGARCH", "armv7a") |
141 | 141 | ||
142 | def preferred_ml_updates(d): | ||
143 | # If any PREFERRED_PROVIDER or PREFERRED_VERSIONS are set, | ||
144 | # we need to mirror these variables in the multilib case | ||
145 | multilibs = d.getVar('MULTILIBS', True) or "" | ||
146 | if not multilibs: | ||
147 | return | ||
148 | |||
149 | prefixes = [] | ||
150 | for ext in multilibs.split(): | ||
151 | eext = ext.split(':') | ||
152 | if len(eext) > 1 and eext[0] == 'multilib': | ||
153 | prefixes.append(eext[1]) | ||
154 | |||
155 | versions = [] | ||
156 | providers = [] | ||
157 | for v in d.keys(): | ||
158 | if v.startswith("PREFERRED_VERSION_"): | ||
159 | versions.append(v) | ||
160 | if v.startswith("PREFERRED_PROVIDER_"): | ||
161 | providers.append(v) | ||
162 | |||
163 | for v in versions: | ||
164 | val = d.getVar(v, False) | ||
165 | pkg = v.replace("PREFERRED_VERSION_", "") | ||
166 | if pkg.endswith("-native") or pkg.endswith("-nativesdk"): | ||
167 | continue | ||
168 | for p in prefixes: | ||
169 | newname = "PREFERRED_VERSION_" + p + "-" + pkg | ||
170 | if not d.getVar(newname, False): | ||
171 | d.setVar(newname, val) | ||
172 | |||
173 | for prov in providers: | ||
174 | val = d.getVar(prov, False) | ||
175 | pkg = prov.replace("PREFERRED_PROVIDER_", "") | ||
176 | if pkg.endswith("-native") or pkg.endswith("-nativesdk"): | ||
177 | continue | ||
178 | virt = "" | ||
179 | if pkg.startswith("virtual/"): | ||
180 | pkg = pkg.replace("virtual/", "") | ||
181 | virt = "virtual/" | ||
182 | for p in prefixes: | ||
183 | newname = "PREFERRED_PROVIDER_" + virt + p + "-" + pkg | ||
184 | if not d.getVar(newname, False): | ||
185 | d.setVar(newname, p + "-" + val) | ||
142 | 186 | ||
143 | addhandler base_eventhandler | 187 | addhandler base_eventhandler |
144 | python base_eventhandler() { | 188 | python base_eventhandler() { |
@@ -211,6 +255,7 @@ python base_eventhandler() { | |||
211 | if name == "ConfigParsed": | 255 | if name == "ConfigParsed": |
212 | generate_git_config(e) | 256 | generate_git_config(e) |
213 | pkgarch_mapping(e.data) | 257 | pkgarch_mapping(e.data) |
258 | preferred_ml_updates(e.data) | ||
214 | 259 | ||
215 | if not data in e.__dict__: | 260 | if not data in e.__dict__: |
216 | return | 261 | return |