summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/staging.bbclass25
1 files changed, 20 insertions, 5 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index a0b74a2258..590be61a62 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -328,6 +328,7 @@ python extend_recipe_sysroot() {
328 import subprocess 328 import subprocess
329 import errno 329 import errno
330 import collections 330 import collections
331 import glob
331 332
332 taskdepdata = d.getVar("BB_TASKDEPDATA", False) 333 taskdepdata = d.getVar("BB_TASKDEPDATA", False)
333 mytaskname = d.getVar("BB_RUNTASK") 334 mytaskname = d.getVar("BB_RUNTASK")
@@ -612,6 +613,7 @@ python extend_recipe_sysroot() {
612 # to be insignificant 613 # to be insignificant
613 taskindex = depdir + "/" + "index." + mytaskname 614 taskindex = depdir + "/" + "index." + mytaskname
614 if os.path.exists(taskindex): 615 if os.path.exists(taskindex):
616 potential = []
615 with open(taskindex, "r") as f: 617 with open(taskindex, "r") as f:
616 for l in f: 618 for l in f:
617 l = l.strip() 619 l = l.strip()
@@ -620,11 +622,24 @@ python extend_recipe_sysroot() {
620 if not os.path.exists(l): 622 if not os.path.exists(l):
621 # Was likely already uninstalled 623 # Was likely already uninstalled
622 continue 624 continue
623 bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l)) 625 potential.append(l)
624 lnk = os.readlink(l) 626 # We need to ensure not other task needs this dependency. We hold the sysroot
625 sstate_clean_manifest(depdir + "/" + lnk, d, workdir) 627 # lock so we ca search the indexes to check
626 os.unlink(l) 628 if potential:
627 os.unlink(l + ".complete") 629 for i in glob.glob(depdir + "/index.*"):
630 if i.endswith("." + mytaskname):
631 continue
632 with open(i, "r") as f:
633 for l in f:
634 l = l.strip()
635 if l in potential:
636 potential.remove(l)
637 for l in potential:
638 bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l))
639 lnk = os.readlink(l)
640 sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
641 os.unlink(l)
642 os.unlink(l + ".complete")
628 with open(taskindex, "w") as f: 643 with open(taskindex, "w") as f:
629 for l in sorted(installed): 644 for l in sorted(installed):
630 f.write(l + "\n") 645 f.write(l + "\n")