[2/3] Go: Cleanup Go Path after build

Message ID 20191224125854.11552-2-michael.tremer@ipfire.org
State Accepted
Commit cde41c2e6f65cb16fc5e5466a6f78da46e30859b
Headers show
Series [1/3] amazon-ssm-agent: New package | expand

Commit Message

Michael Tremer Dec. 24, 2019, 12:58 p.m. UTC
Go leaves temporary build files in the directory
which we do not need and we should clean up after
every build.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 lfs/Config           | 4 ++++
 lfs/amazon-ssm-agent | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/lfs/Config b/lfs/Config
index f597b8c65..d17600820 100644
--- a/lfs/Config
+++ b/lfs/Config
@@ -115,6 +115,9 @@  ifeq "$(BUILD_ARCH)" "aarch64"
 	GRUB_ARCH = arm64
 endif
 
+# Go
+export GOPATH = $(HOME)/gopath
+
 ###############################################################################
 # Common Macro Definitions
 ###############################################################################
@@ -156,6 +159,7 @@  define POSTBUILD
 	@echo "Updating linker cache..."
 	@type -p ldconfig >/dev/null && ldconfig || :
 	@echo "Install done; saving file list to $(TARGET) ..."
+	@rm -rf $(GOPATH)
 	@$(FIND_FILES) > $(DIR_SRC)/lsalrnew
 	@diff $(DIR_SRC)/lsalr $(DIR_SRC)/lsalrnew | grep '^> ' | sed 's/^> //' > $(TARGET)_diff
 	@cp -f $(DIR_SRC)/lsalrnew $(DIR_SRC)/lsalr
diff --git a/lfs/amazon-ssm-agent b/lfs/amazon-ssm-agent
index da164ced8..b477690a4 100644
--- a/lfs/amazon-ssm-agent
+++ b/lfs/amazon-ssm-agent
@@ -37,8 +37,6 @@  PAK_VER    = 1
 
 DEPS       = ""
 
-export GOPATH = $(HOME)/gopath
-
 DIR_BUILD  = $(GOPATH)/src/github.com/aws/amazon-ssm-agent
 
 ###############################################################################