diff mbox

toolchain-external: make extraction idempotent

Message ID 1446592175-8003-1-git-send-email-arnout@mind.be
State Accepted
Headers show

Commit Message

Arnout Vandecappelle Nov. 3, 2015, 11:09 p.m. UTC
Commit 23ffa7ec first extracts to the toolchain-external build
directory and then moves everything to $(HOST_DIR)/opt/ext-toolchain.
However, this is not idempotent, because moving directories over
existing ones doesn't always work, particularly if the target is on
another device.

Simply remove the destination contents before moving.

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

Comments

Thomas Petazzoni Nov. 4, 2015, 7:33 a.m. UTC | #1
Dear Arnout Vandecappelle (Essensium/Mind),

On Wed, 4 Nov 2015 00:09:35 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Commit 23ffa7ec first extracts to the toolchain-external build
> directory and then moves everything to $(HOST_DIR)/opt/ext-toolchain.
> However, this is not idempotent, because moving directories over
> existing ones doesn't always work, particularly if the target is on
> another device.
> 
> Simply remove the destination contents before moving.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  toolchain/toolchain-external/toolchain-external.mk | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Thomas
diff mbox

Patch

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index e1e8d2f..fa4ddab 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -483,6 +483,7 @@  TOOLCHAIN_EXTERNAL_EXCLUDES = usr/lib/locale/*
 # since it's actually a fairly special package, we need it to be moved
 # into TOOLCHAIN_EXTERNAL_INSTALL_DIR.
 define TOOLCHAIN_EXTERNAL_MOVE
+	rm -rf $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/*
 	mkdir -p $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)
 	mv $(@D)/* $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/
 endef