[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7652/8267] staging: gracefully abort if two recipes conflict in the sysroot
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7652/8267] staging: gracefully abort if two recipes conflict in the sysroot
- Date: Sun, 17 Dec 2017 06:32:55 +0000 (UTC)
commit e3a69364eb1fdbf1dcb98a04b3ddfc8f9841a7fa
Author: Ross Burton <ross burton intel com>
Date: Tue Sep 5 20:24:20 2017 +0100
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>
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 a774088..6185aef 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -388,6 +388,8 @@ python extend_recipe_sysroot() {
postinsts = []
multilibs = {}
manifests = {}
+ # All files that we're going to be installing, to find conflicts.
+ fileset = {}
for f in os.listdir(depdir):
if not f.endswith(".complete"):
@@ -514,8 +516,19 @@ python extend_recipe_sysroot() {
if l.endswith("/fixmepath.cmd"):
continue
dest = l.replace(stagingdir, "")
- dest = targetdir + "/" + "/".join(dest.split("/")[3:])
- newmanifest[l] = dest
+ dest = "/" + "/".join(dest.split("/")[3:])
+ newmanifest[l] = targetdir + dest
+
+ # Check if files have already been installed by another
+ # recipe and abort if they have, explaining what recipes are
+ # conflicting.
+ hashname = targetdir + dest
+ if not hashname.endswith("/"):
+ if hashname in fileset:
+ bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c,
fileset[hashname]))
+ else:
+ fileset[hashname] = c
+
# Having multiple identical manifests in each sysroot eats diskspace so
# create a shared pool of them and hardlink if we can.
# We create the manifest in advance so that if something fails during installation,
@@ -594,4 +607,3 @@ python staging_taskhandler() {
}
staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
addhandler staging_taskhandler
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]