summaryrefslogtreecommitdiffstats
path: root/meta/classes/siteinfo.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/siteinfo.bbclass')
-rw-r--r--meta/classes/siteinfo.bbclass34
1 files changed, 28 insertions, 6 deletions
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 0bd1f36805..c5f4dfda41 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -176,17 +176,39 @@ python () {
176 bb.fatal("Please add your architecture to siteinfo.bbclass") 176 bb.fatal("Please add your architecture to siteinfo.bbclass")
177} 177}
178 178
179def siteinfo_get_files(d, sysrootcache = False): 179# Layers with siteconfig need to add a replacement path to this variable so the
180# sstate isn't path specific
181SITEINFO_PATHVARS = "COREBASE"
182
183def siteinfo_get_files(d, sysrootcache=False):
180 sitedata = siteinfo_data(d) 184 sitedata = siteinfo_data(d)
181 sitefiles = "" 185 sitefiles = []
186 searched = []
182 for path in d.getVar("BBPATH").split(":"): 187 for path in d.getVar("BBPATH").split(":"):
183 for element in sitedata: 188 for element in sitedata:
184 filename = os.path.join(path, "site", element) 189 filename = os.path.join(path, "site", element)
185 if os.path.exists(filename): 190 if os.path.exists(filename):
186 sitefiles += filename + " " 191 searched.append(filename + ":True")
192 sitefiles.append(filename)
193 else:
194 searched.append(filename + ":False")
195
196 # Have to parameterise out hardcoded paths such as COREBASE for the main site files
197 for var in d.getVar("SITEINFO_PATHVARS").split():
198 searched2 = []
199 replace = os.path.normpath(d.getVar(var))
200 for s in searched:
201 searched2.append(s.replace(replace, "${" + var + "}"))
202 searched = searched2
203
204 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
205 # We need sstate sigs for native/cross not to vary upon arch so we can't depend on the site files.
206 # In future we may want to depend upon all site files?
207 # This would show up as breaking sstatetests.SStateTests.test_sstate_32_64_same_hash for example
208 searched = []
187 209
188 if not sysrootcache: 210 if not sysrootcache:
189 return sitefiles 211 return sitefiles, searched
190 212
191 # Now check for siteconfig cache files in sysroots 213 # Now check for siteconfig cache files in sysroots
192 path_siteconfig = d.getVar('SITECONFIG_SYSROOTCACHE') 214 path_siteconfig = d.getVar('SITECONFIG_SYSROOTCACHE')
@@ -195,8 +217,8 @@ def siteinfo_get_files(d, sysrootcache = False):
195 if not i.endswith("_config"): 217 if not i.endswith("_config"):
196 continue 218 continue
197 filename = os.path.join(path_siteconfig, i) 219 filename = os.path.join(path_siteconfig, i)
198 sitefiles += filename + " " 220 sitefiles.append(filename)
199 return sitefiles 221 return sitefiles, searched
200 222
201# 223#
202# Make some information available via variables 224# Make some information available via variables