]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate.bbclass: Improve stamp-extra-info task handling to avoid warnings
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 15:39:56 +0000 (15:39 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 17 Dec 2012 17:21:47 +0000 (17:21 +0000)
If you change a machine to a different package architecture, you will see sstate
errors about overwriting files as the code stands today. Instead it should clean
out the files safely and correctly. This patch changes the naming of stamp-extra-info
manifest files to avoid this problem. It will potentially trigger warnings during
builds in existing TMPDIRs until the system adjusts to the new naming, these are
harmless.

[YOCTO #3521]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index d3daf1c35dbaa404ffa0d43178090c95e0652c7b..d544da97d6717260ae0b2545bf24420365819155 100644 (file)
@@ -124,10 +124,12 @@ def sstate_install(ss, d):
     sharedfiles = []
     shareddirs = []
     bb.mkdirhier(d.expand("${SSTATE_MANIFESTS}"))
-    manifest = d.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
+
+    d2 = d.createCopy()
     extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
     if extrainf:
-        manifest = manifest + "." + extrainf
+        d2.setVar("SSTATE_MANMACH", extrainf)
+    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
 
     if os.access(manifest, os.R_OK):
         bb.fatal("Package already staged (%s)?!" % manifest)
@@ -315,10 +317,11 @@ def sstate_clean_manifest(manifest, d):
 def sstate_clean(ss, d):
     import oe.path
 
-    manifest = d.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
+    d2 = d.createCopy()
     extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
     if extrainf:
-        manifest = manifest + "." + extrainf
+        d2.setVar("SSTATE_MANMACH", extrainf)
+    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['name'])
 
     if os.path.exists(manifest):
         locks = []