1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

staging: Handle files moving between dependencies

Currently, if files move between recipes, do_prepare_sysroot can fail with a message like

Exception: FileExistsError: [Errno 17] File exists:
'TMPDIR/sysroots-components/core2-64/libx11/usr/include/X11/extensions/XKBgeom.h' ->
'TMPDIR/work/core2-64-poky-linux/gtk+3/3.24.8-r0/recipe-sysroot/usr/include/X11/extensions/XKBgeom.h'

This is because files are removed and then added per package. What needs to
happen is all removes need to be processed, then all additions.

This patch changes the code to process in two phases, removals first, then additions,
which avoids the problem.

(From OE-Core rev: e3e5ace6e68d5fe68e4add301a44c1a1b8607411)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2019-11-04 17:27:52 +00:00
parent d427f58977
commit 61f5370c9b
+22 -8
View File
@@ -449,6 +449,28 @@ python extend_recipe_sysroot() {
msg_exists = []
msg_adding = []
# Handle all removals first since files may move between recipes
for dep in configuredeps:
c = setscenedeps[dep][0]
if c not in installed:
continue
taskhash = setscenedeps[dep][5]
taskmanifest = depdir + "/" + c + "." + taskhash
if os.path.exists(depdir + "/" + c):
lnk = os.readlink(depdir + "/" + c)
if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
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)
os.unlink(depdir + "/" + c)
if os.path.lexists(depdir + "/" + c + ".complete"):
os.unlink(depdir + "/" + c + ".complete")
elif os.path.lexists(depdir + "/" + c):
os.unlink(depdir + "/" + c)
# Now handle installs
for dep in configuredeps:
c = setscenedeps[dep][0]
if c not in installed:
@@ -461,14 +483,6 @@ python extend_recipe_sysroot() {
if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
msg_exists.append(c)
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)
os.unlink(depdir + "/" + c)
if os.path.lexists(depdir + "/" + c + ".complete"):
os.unlink(depdir + "/" + c + ".complete")
elif os.path.lexists(depdir + "/" + c):
os.unlink(depdir + "/" + c)
msg_adding.append(c)