diff options
| -rw-r--r-- | meta/classes/staging.bbclass | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index 6dd21e8ec4..27fcd1efa9 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass | |||
| @@ -469,6 +469,8 @@ python extend_recipe_sysroot() { | |||
| 469 | multilibs = {} | 469 | multilibs = {} |
| 470 | manifests = {} | 470 | manifests = {} |
| 471 | 471 | ||
| 472 | installed = [] | ||
| 473 | |||
| 472 | for f in os.listdir(depdir): | 474 | for f in os.listdir(depdir): |
| 473 | if not f.endswith(".complete"): | 475 | if not f.endswith(".complete"): |
| 474 | continue | 476 | continue |
| @@ -487,6 +489,9 @@ python extend_recipe_sysroot() { | |||
| 487 | if mytaskname in ["do_sdk_depends", "do_populate_sdk_ext"] and c.endswith("-initial"): | 489 | if mytaskname in ["do_sdk_depends", "do_populate_sdk_ext"] and c.endswith("-initial"): |
| 488 | bb.note("Skipping initial setscene dependency %s for installation into the sysroot" % c) | 490 | bb.note("Skipping initial setscene dependency %s for installation into the sysroot" % c) |
| 489 | continue | 491 | continue |
| 492 | |||
| 493 | installed.append(c) | ||
| 494 | |||
| 490 | if os.path.exists(depdir + "/" + c): | 495 | if os.path.exists(depdir + "/" + c): |
| 491 | lnk = os.readlink(depdir + "/" + c) | 496 | lnk = os.readlink(depdir + "/" + c) |
| 492 | if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"): | 497 | if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"): |
| @@ -601,6 +606,29 @@ python extend_recipe_sysroot() { | |||
| 601 | c = setscenedeps[dep][0] | 606 | c = setscenedeps[dep][0] |
| 602 | os.symlink(manifests[dep], depdir + "/" + c + ".complete") | 607 | os.symlink(manifests[dep], depdir + "/" + c + ".complete") |
| 603 | 608 | ||
| 609 | # We want to remove anything which this task previously installed but is no longer a dependency | ||
| 610 | # This could potentially race against another task which also installed it but still requires it | ||
| 611 | # but the alternative is not doing anything at all and that race window should be small enough | ||
| 612 | # to be insignificant | ||
| 613 | taskindex = depdir + "/" + "index." + mytaskname | ||
| 614 | if os.path.exists(taskindex): | ||
| 615 | with open(taskindex, "r") as f: | ||
| 616 | for l in f: | ||
| 617 | l = l.strip() | ||
| 618 | if l not in installed: | ||
| 619 | l = depdir + "/" + l | ||
| 620 | if not os.path.exists(l): | ||
| 621 | # Was likely already uninstalled | ||
| 622 | continue | ||
| 623 | bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l)) | ||
| 624 | lnk = os.readlink(l) | ||
| 625 | sstate_clean_manifest(depdir + "/" + lnk, d, workdir) | ||
| 626 | os.unlink(l) | ||
| 627 | os.unlink(l + ".complete") | ||
| 628 | with open(taskindex, "w") as f: | ||
| 629 | for l in sorted(installed): | ||
| 630 | f.write(l + "\n") | ||
| 631 | |||
| 604 | bb.utils.unlockfile(lock) | 632 | bb.utils.unlockfile(lock) |
| 605 | } | 633 | } |
| 606 | extend_recipe_sysroot[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA" | 634 | extend_recipe_sysroot[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA" |
