toolchain-external: make extraction idempotent
authorArnout Vandecappelle <arnout@mind.be>
Tue, 3 Nov 2015 23:09:35 +0000 (00:09 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 4 Nov 2015 07:31:09 +0000 (08:31 +0100)
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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
toolchain/toolchain-external/toolchain-external.mk

index 18e6808fc76927eabfe98e3b53d2e6b43bd07029..958ab183c282b75ade52369d158d0ebdf2ecbf19 100644 (file)
@@ -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