All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] sstate.bbclass: Improve stamp-extra-info task handling to avoid warnings
Date: Fri, 14 Dec 2012 15:39:56 +0000	[thread overview]
Message-ID: <1355499596.32519.22.camel@ted> (raw)

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>
---
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index d3daf1c..94be3ce 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -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,12 @@ 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'])
+    bb.error(str(manifest))
 
     if os.path.exists(manifest):
         locks = []





                 reply	other threads:[~2012-12-14 15:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355499596.32519.22.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.