All of lore.kernel.org
 help / color / mirror / Atom feed
* [pyro][PATCH] staging: remove files from multilib workdir
@ 2018-02-28 11:13 Raphael Freudiger
  0 siblings, 0 replies; only message in thread
From: Raphael Freudiger @ 2018-02-28 11:13 UTC (permalink / raw)
  To: openembedded-core

Packages with a different architecture will be installed in a different multilib workdir.
When those packages are updated, it will remove the files from the default workdir,
but not from the multilib workdir.
This will throw a file exists error later on.
Remove the files from the multilib workdir for packages that are installed into the multilib workdir.

Signed-off-by: Raphael Freudiger <raphael.freudiger@siemens.com>
---
 meta/classes/staging.bbclass | 47 ++++++++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index 984051d6aa..2e836adce4 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -470,6 +470,10 @@ python extend_recipe_sysroot() {
     multilibs = {}
     manifests = {}
 
+    multilib_variants = (d.getVar("MULTILIBS") or "").split()
+    if multilib_variants:
+        multilib_variants = [variant.split(":")[1] for variant in multilib_variants]
+
     for f in os.listdir(depdir):
         if not f.endswith(".complete"):
             continue
@@ -477,7 +481,15 @@ python extend_recipe_sysroot() {
         if os.path.islink(f) and not os.path.exists(f):
             bb.note("%s no longer exists, removing from sysroot" % f)
             lnk = os.readlink(f.replace(".complete", ""))
-            sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+            dep = os.path.basename(f).replace(".complete", "")
+            d2 = d
+            for variant in multilib_variants:
+                if dep.startswith(variant+"-"):
+                    if variant not in multilibs:
+                        multilibs[variant] = get_multilib_datastore(variant, d)
+                    d2 = multilibs[variant]
+                    break
+            sstate_clean_manifest(depdir + "/" + lnk, d2, d2.getVar("WORKDIR"))
             os.unlink(f)
             os.unlink(f.replace(".complete", ""))
 
@@ -517,7 +529,14 @@ python extend_recipe_sysroot() {
             fl = depdir + "/" + l
             bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l))
             lnk = os.readlink(fl)
-            sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+            d2 = d
+            for variant in multilib_variants:
+                if l.startswith(variant+"-"):
+                    if variant not in multilibs:
+                        multilibs[variant] = get_multilib_datastore(variant, d)
+                    d2 = multilibs[variant]
+                    break
+            sstate_clean_manifest(depdir + "/" + lnk, d2, d2.getVar("WORKDIR"))
             os.unlink(fl)
             os.unlink(fl + ".complete")
 
@@ -528,6 +547,18 @@ python extend_recipe_sysroot() {
         taskhash = setscenedeps[dep][5]
         taskmanifest = depdir + "/" + c + "." + taskhash
 
+        d2 = d
+        destsysroot = recipesysroot
+        variant = ''
+        # get multilib datastore if needed
+        if setscenedeps[dep][2].startswith("virtual:multilib"):
+            variant = setscenedeps[dep][2].split(":")[2]
+            if variant != current_variant:
+                if variant not in multilibs:
+                    multilibs[variant] = get_multilib_datastore(variant, d)
+                d2 = multilibs[variant]
+                destsysroot = d2.getVar("RECIPE_SYSROOT")
+
         if os.path.exists(depdir + "/" + c):
             lnk = os.readlink(depdir + "/" + c)
             if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
@@ -535,7 +566,7 @@ python extend_recipe_sysroot() {
                 continue
             else:
                 bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash))
-                sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+                sstate_clean_manifest(depdir + "/" + lnk, d2, d2.getVar("WORKDIR"))
                 os.unlink(depdir + "/" + c)
                 if os.path.lexists(depdir + "/" + c + ".complete"):
                     os.unlink(depdir + "/" + c + ".complete")
@@ -544,16 +575,6 @@ python extend_recipe_sysroot() {
 
         os.symlink(c + "." + taskhash, depdir + "/" + c)
 
-        d2 = d
-        destsysroot = recipesysroot
-        variant = ''
-        if setscenedeps[dep][2].startswith("virtual:multilib"):
-            variant = setscenedeps[dep][2].split(":")[2]
-            if variant != current_variant:
-                if variant not in multilibs:
-                    multilibs[variant] = get_multilib_datastore(variant, d)
-                d2 = multilibs[variant]
-                destsysroot = d2.getVar("RECIPE_SYSROOT")
 
         native = False
         if c.endswith("-native"):
-- 
2.11.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-28 11:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 11:13 [pyro][PATCH] staging: remove files from multilib workdir Raphael Freudiger

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.