Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages
@ 2013-08-22 11:29 Richard Purdie
  2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: Richard Purdie @ 2013-08-22 11:29 UTC (permalink / raw)
  To: openembedded-core

When copying the sources for the debug source package we use cpio -Ll
which means to copy files as hardlinks and to dereference symlinks.
It appears there is a bug in cpio since -Ll will copy symlinks and
not dereference them. We therefore do a second pass over copied symlinks
resolving them into files. Ideally we would copy these as hardlinks as well
however it doesn't seem worth the extra code and effort for what amounts
to a corner case for a minor space improvement.

This means that the -dbg packages no longer contain broken symlinks.

[YOCTO #5020]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/package.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2460d0a..f6f9310 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -316,6 +316,12 @@ def copydebugsources(debugsrcdir, d):
         #if retval:
         #    bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd))
 
+        # cpio seems to have a bug with -lL together and symbolic links are just copied, not dereferenced.
+        # Work around this by manually finding and copying any symbolic links that made it through.
+        cmd = "find %s%s -type l -print0 -delete | sed s#%s%s/##g | (cd '%s' ; cpio -pd0mL --no-preserve-owner '%s%s' 2>/dev/null)" % (dvar, debugsrcdir, dvar, debugsrcdir, workparentdir, dvar, debugsrcdir)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.fatal("debugsrc symlink fixup failed with exit code %s (cmd was %s)" % (retval, cmd))
 
         # The copy by cpio may have resulted in some empty directories!  Remove these
         cmd = "find %s%s -empty -type d -delete" % (dvar, debugsrcdir)
-- 
1.8.1.2



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

end of thread, other threads:[~2013-08-22 11:46 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 11:29 [PATCH 01/28] package.bbclass: Fix handling of symlinks in debug packages Richard Purdie
2013-08-22 11:29 ` [PATCH 02/28] crosssdk: Construct target_exec_prefix from prefix_nativesdk Richard Purdie
2013-08-22 11:29 ` [PATCH 03/28] populate_sdk_base: Allow sdk tar options to be overridden Richard Purdie
2013-08-22 11:29 ` [PATCH 04/28] gettext: Improve USE_NLS handling for nativesdk/crosssdk/cross-canadian Richard Purdie
2013-08-22 11:29 ` [PATCH 05/28] libiconv: Extend to nativesdk and support non-linux targets Richard Purdie
2013-08-22 11:29 ` [PATCH 06/28] gcc-cross-canadian-4.8: Enable PARALLEL_MAKE Richard Purdie
2013-08-22 11:29 ` [PATCH 07/28] gcc-package-sdk.inc: Use relative symlinks in libexec dir Richard Purdie
2013-08-22 11:29 ` [PATCH 08/28] gcc-package-sdk.inc: Allow executable extension to be overridden Richard Purdie
2013-08-22 11:29 ` [PATCH 09/28] gcc-configure-sdk.inc: Don't build target-libgcc Richard Purdie
2013-08-22 11:29 ` [PATCH 10/28] gcc: Drop gcc-cross4.inc, its pointless now Richard Purdie
2013-08-22 11:29 ` [PATCH 11/28] gcc-cross-canadian-4.8: Allow elfutils to be a configurable dependency Richard Purdie
2013-08-22 11:29 ` [PATCH 12/28] gcc-cross-canadian-4.8: Add missing dependency on nativesdk-zlib Richard Purdie
2013-08-22 11:29 ` [PATCH 13/28] gcc-cross-canadian: Merge 4.7 and 4.8 recipes into common include Richard Purdie
2013-08-22 11:29 ` [PATCH 14/28] Revert "nativesdk: inherit relocatable" Richard Purdie
2013-08-22 11:29 ` [PATCH 15/28] bitbake.conf/classes/gcc: Don't hardcode -nativesdk Richard Purdie
2013-08-22 11:29 ` [PATCH 16/28] gcc-cross: Fold common configuration into gcc-cross.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 17/28] gcc-cross-initial: Fold common configuration into gcc-cross-initial.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 18/28] gcc-runtime: Fold common configuration into gcc-configure-runtime.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 19/28] libgcc: Move common code to libgcc.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 20/28] gcc-target: Combine gcc-target-configure.inc, gcc-target-package.inc and other common code Richard Purdie
2013-08-22 11:29 ` [PATCH 21/28] gcc-*-cross.inc: Fold common configuration into gcc-cross.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 22/28] gcc-*-runtime.inc: Fold configuration into gcc-runtime.inc Richard Purdie
2013-08-22 11:29 ` [PATCH 23/28] gcc-cross-canadian: Fold configure-sdk and package-sdk into the main .inc Richard Purdie
2013-08-22 11:29 ` [PATCH 24/28] gcc-cross.inc: Clean up after merge Richard Purdie
2013-08-22 11:29 ` [PATCH 25/28] gcc-common.inc: Drop unused LIBGCCS_VAR variable Richard Purdie
2013-08-22 11:29 ` [PATCH 26/28] bitbake.conf: Work around dev symlink problems on darwin Richard Purdie
2013-08-22 11:29 ` [PATCH 27/28] Drop darwin8/darwin9 usage Richard Purdie
2013-08-22 11:30 ` [PATCH 28/28] chrpath: Add support for relocating darwin binaries Richard Purdie
2013-08-22 11:46 ` [PATCH 00/28] Toolchain tweaks Richard Purdie

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