summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 13:56:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:05 +0000
commit480bf037ae437689e16cbdcef0208c4298268fc4 (patch)
tree6fadc3a4dc65e592e15699e12cd48efc1635d831 /meta/classes/sstate.bbclass
parent7935ae2e805d935f0f7f38e06e5ef94482540041 (diff)
downloadpoky-480bf037ae437689e16cbdcef0208c4298268fc4.tar.gz
sstate: Get rid of crazy name mapping
When originally developed, it was thought a task may have more than one associated sstate archive. The way the code has grown that idea is now not possible or needed. We can therefore assume one sstate archive per task and drop the crazy name mapping code. Simpler is better in this case. The downside is that various sstate archives will change name so this forces a cache rebuild. Given the other sstate changes going in at this time, this isn't really a bad thing as things would rebuild anyway. (From OE-Core rev: 5afe86a6854b21692fd97c5fc7fab50dbc068acb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass26
1 files changed, 6 insertions, 20 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 9df9ac2429..199a5b3fc4 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -69,12 +69,9 @@ python () {
69 69
70 unique_tasks = set((d.getVar('SSTATETASKS', True) or "").split()) 70 unique_tasks = set((d.getVar('SSTATETASKS', True) or "").split())
71 d.setVar('SSTATETASKS', " ".join(unique_tasks)) 71 d.setVar('SSTATETASKS', " ".join(unique_tasks))
72 namemap = []
73 for task in unique_tasks: 72 for task in unique_tasks:
74 namemap.append(d.getVarFlag(task, 'sstate-name'))
75 d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ") 73 d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
76 d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") 74 d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
77 d.setVar('SSTATETASKNAMES', " ".join(namemap))
78} 75}
79 76
80def sstate_init(name, task, d): 77def sstate_init(name, task, d):
@@ -94,7 +91,9 @@ def sstate_state_fromvars(d, task = None):
94 bb.fatal("sstate code running without task context?!") 91 bb.fatal("sstate code running without task context?!")
95 task = task.replace("_setscene", "") 92 task = task.replace("_setscene", "")
96 93
97 name = d.getVarFlag("do_" + task, 'sstate-name', True) 94 name = task
95 if task.startswith("do_"):
96 name = task[3:]
98 inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split() 97 inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split()
99 outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split() 98 outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
100 plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split() 99 plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
@@ -297,7 +296,7 @@ def sstate_clean_cachefile(ss, d):
297 296
298def sstate_clean_cachefiles(d): 297def sstate_clean_cachefiles(d):
299 for task in (d.getVar('SSTATETASKS', True) or "").split(): 298 for task in (d.getVar('SSTATETASKS', True) or "").split():
300 ss = sstate_state_fromvars(d, task[3:]) 299 ss = sstate_state_fromvars(d, task)
301 sstate_clean_cachefile(ss, d) 300 sstate_clean_cachefile(ss, d)
302 301
303def sstate_clean_manifest(manifest, d): 302def sstate_clean_manifest(manifest, d):
@@ -365,11 +364,9 @@ python sstate_cleanall() {
365 if not os.path.exists(manifest_dir): 364 if not os.path.exists(manifest_dir):
366 return 365 return
367 366
368 namemap = d.getVar('SSTATETASKNAMES', True).split()
369 tasks = d.getVar('SSTATETASKS', True).split() 367 tasks = d.getVar('SSTATETASKS', True).split()
370 for name in namemap: 368 for name in tasks:
371 taskname = tasks[namemap.index(name)] 369 shared_state = sstate_state_fromvars(d, name)
372 shared_state = sstate_state_fromvars(d, taskname[3:])
373 sstate_clean(shared_state, d) 370 sstate_clean(shared_state, d)
374} 371}
375 372
@@ -592,20 +589,11 @@ sstate_unpack_package () {
592 tar -xmvzf ${SSTATE_PKG} 589 tar -xmvzf ${SSTATE_PKG}
593} 590}
594 591
595# Need to inject information about classes not in the global configuration scope
596EXTRASSTATEMAPS += "do_deploy:deploy"
597
598BB_HASHCHECK_FUNCTION = "sstate_checkhashes" 592BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
599 593
600def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): 594def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
601 595
602 ret = [] 596 ret = []
603 mapping = {}
604 for t in d.getVar("SSTATETASKS", True).split():
605 mapping[t] = d.getVarFlag(t, "sstate-name", True)
606 for extra in d.getVar("EXTRASSTATEMAPS", True).split():
607 e = extra.split(":")
608 mapping[e[0]] = e[1]
609 597
610 def getpathcomponents(task, d): 598 def getpathcomponents(task, d):
611 # Magic data from BB_HASHFILENAME 599 # Magic data from BB_HASHFILENAME
@@ -614,8 +602,6 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
614 extrapath = splithashfn[0] 602 extrapath = splithashfn[0]
615 603
616 tname = sq_task[task][3:] 604 tname = sq_task[task][3:]
617 if sq_task[task] in mapping:
618 tname = mapping[sq_task[task]]
619 605
620 if tname in ["fetch", "unpack", "patch"] and splithashfn[2]: 606 if tname in ["fetch", "unpack", "patch"] and splithashfn[2]:
621 spec = splithashfn[2] 607 spec = splithashfn[2]