diff options
author | Ross Burton <ross.burton@intel.com> | 2017-09-05 20:24:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-11 17:30:30 +0100 |
commit | e3a69364eb1fdbf1dcb98a04b3ddfc8f9841a7fa (patch) | |
tree | 91340db08562486e88f5b195ff98d079947bc8f6 /meta/classes | |
parent | 6426136655cb00996c1870e2075a57716bfba846 (diff) | |
download | poky-e3a69364eb1fdbf1dcb98a04b3ddfc8f9841a7fa.tar.gz |
staging: gracefully abort if two recipes conflict in the sysroot
When building the per-recipe sysroot keep track of what files we're installing
and where they came from, so we can detect when a file is installed by two
different recipes and tell the user what these recipes are (instead of just
showing a os.link() stack trace).
[ YOCTO #11631 ]
(From OE-Core rev: 606a8e0ca218f023e362c3678122d36d537f95de)
(From OE-Core rev: 2ebbeb61114e4b847e9164c621ac87b5cf03a299)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/staging.bbclass | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index a774088393..6185aefecd 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass | |||
@@ -388,6 +388,8 @@ python extend_recipe_sysroot() { | |||
388 | postinsts = [] | 388 | postinsts = [] |
389 | multilibs = {} | 389 | multilibs = {} |
390 | manifests = {} | 390 | manifests = {} |
391 | # All files that we're going to be installing, to find conflicts. | ||
392 | fileset = {} | ||
391 | 393 | ||
392 | for f in os.listdir(depdir): | 394 | for f in os.listdir(depdir): |
393 | if not f.endswith(".complete"): | 395 | if not f.endswith(".complete"): |
@@ -514,8 +516,19 @@ python extend_recipe_sysroot() { | |||
514 | if l.endswith("/fixmepath.cmd"): | 516 | if l.endswith("/fixmepath.cmd"): |
515 | continue | 517 | continue |
516 | dest = l.replace(stagingdir, "") | 518 | dest = l.replace(stagingdir, "") |
517 | dest = targetdir + "/" + "/".join(dest.split("/")[3:]) | 519 | dest = "/" + "/".join(dest.split("/")[3:]) |
518 | newmanifest[l] = dest | 520 | newmanifest[l] = targetdir + dest |
521 | |||
522 | # Check if files have already been installed by another | ||
523 | # recipe and abort if they have, explaining what recipes are | ||
524 | # conflicting. | ||
525 | hashname = targetdir + dest | ||
526 | if not hashname.endswith("/"): | ||
527 | if hashname in fileset: | ||
528 | bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname])) | ||
529 | else: | ||
530 | fileset[hashname] = c | ||
531 | |||
519 | # Having multiple identical manifests in each sysroot eats diskspace so | 532 | # Having multiple identical manifests in each sysroot eats diskspace so |
520 | # create a shared pool of them and hardlink if we can. | 533 | # create a shared pool of them and hardlink if we can. |
521 | # We create the manifest in advance so that if something fails during installation, | 534 | # We create the manifest in advance so that if something fails during installation, |
@@ -594,4 +607,3 @@ python staging_taskhandler() { | |||
594 | } | 607 | } |
595 | staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess" | 608 | staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess" |
596 | addhandler staging_taskhandler | 609 | addhandler staging_taskhandler |
597 | |||