All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root
@ 2017-07-05 14:54 Arnout Vandecappelle
  2017-07-05 16:11 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Arnout Vandecappelle @ 2017-07-05 14:54 UTC (permalink / raw)
  To: buildroot

In commit b3cc7e65ee, the definition of the DESTDIR variable was moved
down into the loop that follows symlinks in the libraries that are
copied to target. However, the corresponding mkdir was not moved down,
so that no directories are ever created.

In practice, this mkdir is normally redundant since the directories
should already have been created as part of creating STAGING_DIR.
Still, the current situation is clearly wrong, so fix it by moving the
mkdir down to after the assignment to DESTDIR.

While we're at it, also remove a redundant empty line. It's a leftover
from when a lot of variables were declared above.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 toolchain/helpers.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 6136aef6b9..9942ce404f 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -10,13 +10,12 @@
 #
 copy_toolchain_lib_root = \
 	LIBPATTERN="$(strip $1)"; \
-\
 	LIBPATHS=`find $(STAGING_DIR)/ -name "$${LIBPATTERN}" 2>/dev/null` ; \
 	for LIBPATH in $${LIBPATHS} ; do \
-		mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
 		while true ; do \
 			LIBNAME=`basename $${LIBPATH}`; \
 			DESTDIR=`echo $${LIBPATH} | sed "s,^$(STAGING_DIR)/,," | xargs dirname` ; \
+			mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
 			rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
 			if test -h $${LIBPATH} ; then \
 				cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
-- 
2.13.2

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

* [Buildroot] [PATCH] toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root
  2017-07-05 14:54 [Buildroot] [PATCH] toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root Arnout Vandecappelle
@ 2017-07-05 16:11 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-07-05 16:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 5 Jul 2017 16:54:18 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> In commit b3cc7e65ee, the definition of the DESTDIR variable was moved
> down into the loop that follows symlinks in the libraries that are
> copied to target. However, the corresponding mkdir was not moved down,
> so that no directories are ever created.
> 
> In practice, this mkdir is normally redundant since the directories
> should already have been created as part of creating STAGING_DIR.
> Still, the current situation is clearly wrong, so fix it by moving the
> mkdir down to after the assignment to DESTDIR.
> 
> While we're at it, also remove a redundant empty line. It's a leftover
> from when a lot of variables were declared above.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  toolchain/helpers.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-07-05 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 14:54 [Buildroot] [PATCH] toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root Arnout Vandecappelle
2017-07-05 16:11 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.