From 68ef23ab753467afc46947701e3809655aeea2e3 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 26 Jul 2013 11:00:37 -0700 Subject: [PATCH] external-sourcery-toolchain: only copy existing /usr/ subdirs It seems there are versions of the toolchain which provide empty directories, which is a problem for anyone storing their toolchain in source control. So ensure we only ever copy the paths that exist. Previously, we had left it as is to make sure it *would* break if a path we require is missing, but admittedly not all of these paths are critical, and if something is that badly broken in the toolchain, other things are likely to break elsewhere anyway. Signed-off-by: Christopher Larson --- recipes/meta/external-sourcery-toolchain.bb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index 1a6406b..7185daf 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -39,7 +39,9 @@ do_install() { install -d ${D}/usr for usr_element in bin libexec sbin share ${base_libdir}; do usr_path=$sysroot/usr/$usr_element - cp -a $usr_path ${D}/usr/ + if [ -e "$usr_path" ]; then + cp -a $usr_path ${D}/usr/ + fi done if [ "${base_libdir}" != "lib" ]; then if [ -d $sysroot/usr/lib/locale ]; then @@ -72,8 +74,8 @@ do_install() { ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver fi - sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so - sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so + sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so + sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h create_multilib_link ${D}