summaryrefslogtreecommitdiffstats
path: root/toolchain
diff options
context:
space:
mode:
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>2017-02-07 22:56:38 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-01 23:21:54 +0100
commita07e47a47f57646d9b18aebd47dbfee667e19986 (patch)
tree5f9de7b2d409e62ba0087a84a06b13ef93dd9f5d /toolchain
parent5252d50b68d1af2f3d8afdec53e1417a4d8be4ee (diff)
downloadbuildroot-a07e47a47f57646d9b18aebd47dbfee667e19986.tar.gz
buildroot-a07e47a47f57646d9b18aebd47dbfee667e19986.zip
toolchain-external: reduce nesting in copy_toolchain_sysroot
As discussed with Thomas Petazzoni, we can reduce the nesting level by early returning on an invalid iteration. I did not move the 'else' case (the common case) outside the if-else because it would make the code less symmetrical and IMO makes it _less_ clear. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/helpers.mk9
1 files changed, 5 insertions, 4 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 72e7292353..8cae996a31 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -89,11 +89,12 @@ copy_toolchain_sysroot = \
ARCH_LIB_DIR="$(strip $4)" ; \
SUPPORT_LIB_DIR="$(strip $5)" ; \
for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \
- if [ -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \
- rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \
- --include '/libexec*/' --exclude '/lib*/' \
- $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
+ if [ ! -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \
+ continue ; \
fi ; \
+ rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \
+ --include '/libexec*/' --exclude '/lib*/' \
+ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
done ; \
if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
OpenPOWER on IntegriCloud