* [PATCH V2] siteinfo: generalise siteinfo
@ 2018-09-25 13:46 Ross Burton
0 siblings, 0 replies; only message in thread
From: Ross Burton @ 2018-09-25 13:46 UTC (permalink / raw)
To: openembedded-core
Add a function siteinfo_data_for_machine to look up the data for any arch/os
pair, not just HOST_ARCH-HOST_OS.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/siteinfo.bbclass | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 4698e6e474d..24585d58427 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -15,7 +15,7 @@
# It is an error for the target not to exist.
# If 'what' doesn't exist then an empty value is returned
#
-def siteinfo_data(d):
+def siteinfo_data_for_machine(arch, os, d):
archinfo = {
"allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch
"aarch64": "endian-little bit-64 arm-common arm-64",
@@ -131,15 +131,13 @@ def siteinfo_data(d):
locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d}
archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs)
- hostarch = d.getVar("HOST_ARCH")
- hostos = d.getVar("HOST_OS")
- target = "%s-%s" % (hostarch, hostos)
+ target = "%s-%s" % (arch, os)
sitedata = []
- if hostarch in archinfo:
- sitedata.extend(archinfo[hostarch].split())
- if hostos in osinfo:
- sitedata.extend(osinfo[hostos].split())
+ if arch in archinfo:
+ sitedata.extend(archinfo[arch].split())
+ if os in osinfo:
+ sitedata.extend(osinfo[os].split())
if target in targetinfo:
sitedata.extend(targetinfo[target].split())
sitedata.append(target)
@@ -148,6 +146,9 @@ def siteinfo_data(d):
bb.debug(1, "SITE files %s" % sitedata);
return sitedata
+def siteinfo_data(d):
+ return siteinfo_data_for_machine(d.getVar("HOST_ARCH"), d.getVar("HOST_OS"), d)
+
python () {
sitedata = set(siteinfo_data(d))
if "endian-little" in sitedata:
--
2.11.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-25 13:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-25 13:46 [PATCH V2] siteinfo: generalise siteinfo Ross Burton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox