summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes-global/sstate.bbclass47
1 files changed, 24 insertions, 23 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index f4ebeb5859..beb22f424e 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -223,12 +223,23 @@ def sstate_install(ss, d):
223 import oe.sstatesig 223 import oe.sstatesig
224 import subprocess 224 import subprocess
225 225
226 def prepdir(dir):
227 # remove dir if it exists, ensure any parent directories do exist
228 if os.path.exists(dir):
229 oe.path.remove(dir)
230 bb.utils.mkdirhier(dir)
231 oe.path.remove(dir)
232
233 sstateinst = d.getVar("SSTATE_INSTDIR")
234
235 for state in ss['dirs']:
236 prepdir(state[1])
237 bb.utils.rename(sstateinst + state[0], state[1])
238
226 sharedfiles = [] 239 sharedfiles = []
227 shareddirs = [] 240 shareddirs = []
228 bb.utils.mkdirhier(d.expand("${SSTATE_MANIFESTS}")) 241 bb.utils.mkdirhier(d.expand("${SSTATE_MANIFESTS}"))
229 242
230 sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
231
232 manifest, d2 = oe.sstatesig.sstate_get_manifest_filename(ss['task'], d) 243 manifest, d2 = oe.sstatesig.sstate_get_manifest_filename(ss['task'], d)
233 244
234 if os.access(manifest, os.R_OK): 245 if os.access(manifest, os.R_OK):
@@ -327,6 +338,17 @@ def sstate_install(ss, d):
327 if os.path.exists(state[1]): 338 if os.path.exists(state[1]):
328 oe.path.copyhardlinktree(state[1], state[2]) 339 oe.path.copyhardlinktree(state[1], state[2])
329 340
341 for plain in ss['plaindirs']:
342 workdir = d.getVar('WORKDIR')
343 sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared")
344 src = sstateinst + "/" + plain.replace(workdir, '')
345 if sharedworkdir in plain:
346 src = sstateinst + "/" + plain.replace(sharedworkdir, '')
347 dest = plain
348 bb.utils.mkdirhier(src)
349 prepdir(dest)
350 bb.utils.rename(src, dest)
351
330 for postinst in (d.getVar('SSTATEPOSTINSTFUNCS') or '').split(): 352 for postinst in (d.getVar('SSTATEPOSTINSTFUNCS') or '').split():
331 # All hooks should run in the SSTATE_INSTDIR 353 # All hooks should run in the SSTATE_INSTDIR
332 bb.build.exec_func(postinst, d, (sstateinst,)) 354 bb.build.exec_func(postinst, d, (sstateinst,))
@@ -391,29 +413,8 @@ def sstate_installpkgdir(ss, d):
391 # All hooks should run in the SSTATE_INSTDIR 413 # All hooks should run in the SSTATE_INSTDIR
392 bb.build.exec_func(f, d, (sstateinst,)) 414 bb.build.exec_func(f, d, (sstateinst,))
393 415
394 def prepdir(dir):
395 # remove dir if it exists, ensure any parent directories do exist
396 if os.path.exists(dir):
397 oe.path.remove(dir)
398 bb.utils.mkdirhier(dir)
399 oe.path.remove(dir)
400
401 for state in ss['dirs']:
402 prepdir(state[1])
403 bb.utils.rename(sstateinst + state[0], state[1])
404 sstate_install(ss, d) 416 sstate_install(ss, d)
405 417
406 for plain in ss['plaindirs']:
407 workdir = d.getVar('WORKDIR')
408 sharedworkdir = os.path.join(d.getVar('TMPDIR'), "work-shared")
409 src = sstateinst + "/" + plain.replace(workdir, '')
410 if sharedworkdir in plain:
411 src = sstateinst + "/" + plain.replace(sharedworkdir, '')
412 dest = plain
413 bb.utils.mkdirhier(src)
414 prepdir(dest)
415 bb.utils.rename(src, dest)
416
417 return True 418 return True
418 419
419python sstate_hardcode_path_unpack () { 420python sstate_hardcode_path_unpack () {