summaryrefslogtreecommitdiffstats
path: root/meta/classes/staging.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-26 10:06:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-26 10:44:27 +0000
commitda114c7d7d69b5795cd574d117d961599f72f4cc (patch)
tree1381ea90e695a91d41e2296400e4a04c7e27604c /meta/classes/staging.bbclass
parent7fb3c6a40adb0f6c3032b0a5628c8a56b0e7bd4a (diff)
downloadpoky-da114c7d7d69b5795cd574d117d961599f72f4cc.tar.gz
staging: Handle overlapping files for build-sysroot
The use of bb.fatal means build-sysroots fails as soon as multiple gdb's are built with overlapping files, or multiple recipes with overlapping headers exist. Change the fatal call into an exception which we can then trap. Also avoid trying to call readlink on something with isn't a symlink. This allows build-sysroots to work better under various scenarios. (From OE-Core rev: e20343a90e401bc92167867729076d321081d120) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/staging.bbclass')
-rw-r--r--meta/classes/staging.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index b97f26127f..1fe60ac2cb 100644
--- a/meta/classes/staging.bbclass
+++ b/meta/classes/staging.bbclass
@@ -260,9 +260,11 @@ def staging_copyfile(c, target, fixme, postinsts, stagingdir):
260 if os.path.islink(c): 260 if os.path.islink(c):
261 linkto = os.readlink(c) 261 linkto = os.readlink(c)
262 if os.path.lexists(dest): 262 if os.path.lexists(dest):
263 if not os.path.islink(dest):
264 raise OSError(errno.EEXIST, "Link %s already exists as a file" % dest, dest)
263 if os.readlink(dest) == linkto: 265 if os.readlink(dest) == linkto:
264 return dest 266 return dest
265 bb.fatal("Link %s already exists to a different location?" % dest) 267 raise OSError(errno.EEXIST, "Link %s already exists to a different location? (%s vs %s)" % (dest, os.readlink(dest), linkto), dest)
266 os.symlink(linkto, dest) 268 os.symlink(linkto, dest)
267 #bb.warn(c) 269 #bb.warn(c)
268 else: 270 else:
@@ -331,7 +333,10 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
331 if l.endswith("/"): 333 if l.endswith("/"):
332 staging_copydir(l, targetdir, stagingdir) 334 staging_copydir(l, targetdir, stagingdir)
333 continue 335 continue
334 staging_copyfile(l, targetdir, fixme, postinsts, stagingdir) 336 try:
337 staging_copyfile(l, targetdir, fixme, postinsts, stagingdir)
338 except FileExistsError:
339 continue
335 340
336 staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) 341 staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
337 for p in postinsts: 342 for p in postinsts: