Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] staging: Handle overlapping files for build-sysroot
@ 2017-01-26 10:10 Richard Purdie
  2017-01-26 15:25 ` ✗ patchtest: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2017-01-26 10:10 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/classes/staging.bbclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
index b97f261..1fe60ac 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:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* ✗ patchtest: failure for staging: Handle overlapping files for build-sysroot
  2017-01-26 10:10 [PATCH] staging: Handle overlapping files for build-sysroot Richard Purdie
@ 2017-01-26 15:25 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2017-01-26 15:25 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core

== Series Details ==

Series: staging: Handle overlapping files for build-sysroot
Revision: 1
URL   : https://patchwork.openembedded.org/series/4997/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at a99cca0e8e)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-26 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-26 10:10 [PATCH] staging: Handle overlapping files for build-sysroot Richard Purdie
2017-01-26 15:25 ` ✗ patchtest: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox