diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-26 10:06:35 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-26 10:41:09 +0000 |
commit | e20343a90e401bc92167867729076d321081d120 (patch) | |
tree | cae0f7fc9a330322969cf492c950b2cc65de13e8 | |
parent | bd7d0314038a4c1a8e8c9ebdb7194f8e17db3fef (diff) | |
download | openembedded-core-e20343a90e401bc92167867729076d321081d120.tar.gz openembedded-core-e20343a90e401bc92167867729076d321081d120.tar.bz2 openembedded-core-e20343a90e401bc92167867729076d321081d120.zip |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/staging.bbclass | 9 |
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): if os.path.islink(c): linkto = os.readlink(c) if os.path.lexists(dest): + if not os.path.islink(dest): + raise OSError(errno.EEXIST, "Link %s already exists as a file" % dest, dest) if os.readlink(dest) == linkto: return dest - bb.fatal("Link %s already exists to a different location?" % dest) + raise OSError(errno.EEXIST, "Link %s already exists to a different location? (%s vs %s)" % (dest, os.readlink(dest), linkto), dest) os.symlink(linkto, dest) #bb.warn(c) else: @@ -331,7 +333,10 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): if l.endswith("/"): staging_copydir(l, targetdir, stagingdir) continue - staging_copyfile(l, targetdir, fixme, postinsts, stagingdir) + try: + staging_copyfile(l, targetdir, fixme, postinsts, stagingdir) + except FileExistsError: + continue staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) for p in postinsts: |