summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-04 18:06:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-05 00:14:37 +0100
commitd62302f219547336af8109dd5876ab4b30164c07 (patch)
tree5d53c25b13c38121f15a20a19c92d03ad7581aa4 /meta/classes
parent633818c21b1879cbb24a4d97edf3a7870fe2caf7 (diff)
downloadpoky-d62302f219547336af8109dd5876ab4b30164c07.tar.gz
sstate: Remove name sstate parameter
A while ago we stopped supporting sstate names which were different from the taskname. This patch finishes cleaning up some code remnants from that which were causing data duplication and confusion. (From OE-Core rev: 5a19863e389d28d8db4a86e409c1daa3c6b46eff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/sstate.bbclass29
1 files changed, 13 insertions, 16 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index f371fda6f2..297e29f883 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -78,10 +78,9 @@ python () {
78 d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc") 78 d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
79} 79}
80 80
81def sstate_init(name, task, d): 81def sstate_init(task, d):
82 ss = {} 82 ss = {}
83 ss['task'] = task 83 ss['task'] = task
84 ss['name'] = name
85 ss['dirs'] = [] 84 ss['dirs'] = []
86 ss['plaindirs'] = [] 85 ss['plaindirs'] = []
87 ss['lockfiles'] = [] 86 ss['lockfiles'] = []
@@ -95,24 +94,22 @@ def sstate_state_fromvars(d, task = None):
95 bb.fatal("sstate code running without task context?!") 94 bb.fatal("sstate code running without task context?!")
96 task = task.replace("_setscene", "") 95 task = task.replace("_setscene", "")
97 96
98 name = task
99 if task.startswith("do_"): 97 if task.startswith("do_"):
100 name = task[3:] 98 task = task[3:]
101 task = name
102 inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split() 99 inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split()
103 outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split() 100 outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
104 plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split() 101 plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
105 lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split() 102 lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split()
106 lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split() 103 lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split()
107 interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split() 104 interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split()
108 if not name or len(inputs) != len(outputs): 105 if not task or len(inputs) != len(outputs):
109 bb.fatal("sstate variables not setup correctly?!") 106 bb.fatal("sstate variables not setup correctly?!")
110 107
111 if name == "populate_lic": 108 if task == "populate_lic":
112 d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}") 109 d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
113 d.setVar("SSTATE_EXTRAPATH", "") 110 d.setVar("SSTATE_EXTRAPATH", "")
114 111
115 ss = sstate_init(name, task, d) 112 ss = sstate_init(task, d)
116 for i in range(len(inputs)): 113 for i in range(len(inputs)):
117 sstate_add(ss, inputs[i], outputs[i], d) 114 sstate_add(ss, inputs[i], outputs[i], d)
118 ss['lockfiles'] = lockfiles 115 ss['lockfiles'] = lockfiles
@@ -144,7 +141,7 @@ def sstate_install(ss, d):
144 extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True) 141 extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
145 if extrainf: 142 if extrainf:
146 d2.setVar("SSTATE_MANMACH", extrainf) 143 d2.setVar("SSTATE_MANMACH", extrainf)
147 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name']) 144 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
148 145
149 if os.access(manifest, os.R_OK): 146 if os.access(manifest, os.R_OK):
150 bb.fatal("Package already staged (%s)?!" % manifest) 147 bb.fatal("Package already staged (%s)?!" % manifest)
@@ -230,9 +227,9 @@ def sstate_installpkg(ss, d):
230 bb.utils.mkdirhier(dir) 227 bb.utils.mkdirhier(dir)
231 oe.path.remove(dir) 228 oe.path.remove(dir)
232 229
233 sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['name']) 230 sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
234 sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['name'] + ".tgz" 231 sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['task'] + ".tgz"
235 sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['name'] + ".tgz" 232 sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['task'] + ".tgz"
236 233
237 if not os.path.exists(sstatepkg): 234 if not os.path.exists(sstatepkg):
238 pstaging_fetch(sstatefetch, sstatepkg, d) 235 pstaging_fetch(sstatefetch, sstatepkg, d)
@@ -302,7 +299,7 @@ def sstate_installpkg(ss, d):
302def sstate_clean_cachefile(ss, d): 299def sstate_clean_cachefile(ss, d):
303 import oe.path 300 import oe.path
304 301
305 sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['name'] + ".tgz*" 302 sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['task'] + ".tgz*"
306 bb.note("Removing %s" % sstatepkgfile) 303 bb.note("Removing %s" % sstatepkgfile)
307 oe.path.remove(sstatepkgfile) 304 oe.path.remove(sstatepkgfile)
308 305
@@ -350,7 +347,7 @@ def sstate_clean(ss, d):
350 else: 347 else:
351 wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task']) 348 wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
352 349
353 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name']) 350 manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
354 351
355 if os.path.exists(manifest): 352 if os.path.exists(manifest):
356 locks = [] 353 locks = []
@@ -483,8 +480,8 @@ def sstate_package(ss, d):
483 480
484 tmpdir = d.getVar('TMPDIR', True) 481 tmpdir = d.getVar('TMPDIR', True)
485 482
486 sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['name']) 483 sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
487 sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['name'] + ".tgz" 484 sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['task'] + ".tgz"
488 bb.utils.remove(sstatebuild, recurse=True) 485 bb.utils.remove(sstatebuild, recurse=True)
489 bb.utils.mkdirhier(sstatebuild) 486 bb.utils.mkdirhier(sstatebuild)
490 bb.utils.mkdirhier(os.path.dirname(sstatepkg)) 487 bb.utils.mkdirhier(os.path.dirname(sstatepkg))