sstate: Remove name sstate parameter

Submitted by Richard Purdie on April 4, 2014, 5:06 p.m.

Details

Message ID 1396631192.13862.22.camel@ted
State Accepted
Commit 5a19863e389d28d8db4a86e409c1daa3c6b46eff
Headers show

Commit Message

Richard Purdie April 4, 2014, 5:06 p.m.
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch hide | download patch | download mbox

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index f371fda..297e29f 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -78,10 +78,9 @@  python () {
         d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
 }
 
-def sstate_init(name, task, d):
+def sstate_init(task, d):
     ss = {}
     ss['task'] = task
-    ss['name'] = name
     ss['dirs'] = []
     ss['plaindirs'] = []
     ss['lockfiles'] = []
@@ -95,24 +94,22 @@  def sstate_state_fromvars(d, task = None):
             bb.fatal("sstate code running without task context?!")
         task = task.replace("_setscene", "")
 
-    name = task
     if task.startswith("do_"):
-        name = task[3:]
-        task = name
+        task = task[3:]
     inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split()
     outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
     plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
     lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split()
     lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split()
     interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split()
-    if not name or len(inputs) != len(outputs):
+    if not task or len(inputs) != len(outputs):
         bb.fatal("sstate variables not setup correctly?!")
 
-    if name == "populate_lic":
+    if task == "populate_lic":
         d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
         d.setVar("SSTATE_EXTRAPATH", "")
 
-    ss = sstate_init(name, task, d)
+    ss = sstate_init(task, d)
     for i in range(len(inputs)):
         sstate_add(ss, inputs[i], outputs[i], d)
     ss['lockfiles'] = lockfiles
@@ -144,7 +141,7 @@  def sstate_install(ss, d):
     extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
     if extrainf:
         d2.setVar("SSTATE_MANMACH", extrainf)
-    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
+    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
 
     if os.access(manifest, os.R_OK):
         bb.fatal("Package already staged (%s)?!" % manifest)
@@ -230,9 +227,9 @@  def sstate_installpkg(ss, d):
         bb.utils.mkdirhier(dir)
         oe.path.remove(dir)
 
-    sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['name'])
-    sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['name'] + ".tgz"
-    sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['name'] + ".tgz"
+    sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+    sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['task'] + ".tgz"
+    sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['task'] + ".tgz"
 
     if not os.path.exists(sstatepkg):
         pstaging_fetch(sstatefetch, sstatepkg, d)
@@ -302,7 +299,7 @@  def sstate_installpkg(ss, d):
 def sstate_clean_cachefile(ss, d):
     import oe.path
 
-    sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['name'] + ".tgz*"
+    sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['task'] + ".tgz*"
     bb.note("Removing %s" % sstatepkgfile)
     oe.path.remove(sstatepkgfile)
 
@@ -350,7 +347,7 @@  def sstate_clean(ss, d):
     else:
         wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
 
-    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
+    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
 
     if os.path.exists(manifest):
         locks = []
@@ -483,8 +480,8 @@  def sstate_package(ss, d):
 
     tmpdir = d.getVar('TMPDIR', True)
 
-    sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['name'])
-    sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['name'] + ".tgz"
+    sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
+    sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['task'] + ".tgz"
     bb.utils.remove(sstatebuild, recurse=True)
     bb.utils.mkdirhier(sstatebuild)
     bb.utils.mkdirhier(os.path.dirname(sstatepkg))