From 09465a488adce59dfe3df89e80f18a021df9722f Mon Sep 17 00:00:00 2001
From: Michal Hrusecky <Michal@Hrusecky.net>
Date: Tue, 24 Jul 2018 18:03:44 +0200
Subject: [PATCH] Deal with ccache being set inside if

---
 compile_fw | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compile_fw b/compile_fw
index 043cafbc1..359a6d81f 100755
--- a/compile_fw
+++ b/compile_fw
@@ -295,8 +295,8 @@ set_ccache() {
 	[ -z "$CCACHE_SET" ] || return 0
 	_report "Setting ccache paths"
 	CCACHE_SET=y
-	[ -z "$CCACHE_HOST_DIR" ] || sed -i 's|\(export CCACHE_DIR:=\).*|\1'"$CCACHE_HOST_DIR|" include/host-build.mk
-	[ -z "$CCACHE_TARGET_DIR" ] || [ -z "$TARGET_ARCH" ] || sed -i 's|\(export CCACHE_DIR:=\).*|\1'"$CCACHE_TARGET_DIR/$TARGET_ARCH|" include/package.mk
+	[ -z "$CCACHE_HOST_DIR" ] || sed -i 's|\(export CCACHE_DIR:=\)[^),]*|\1'"$CCACHE_HOST_DIR|" include/host-build.mk
+	[ -z "$CCACHE_TARGET_DIR" ] || [ -z "$TARGET_ARCH" ] || sed -i 's|\(export CCACHE_DIR:=\)[^),]*|\1'"$CCACHE_TARGET_DIR/$TARGET_ARCH)|" include/package.mk
 	[ -z "$(git diff include/host-build.mk include/package.mk)" ] || git commit -m "include: ccache settings" include/host-build.mk include/package.mk
 }
 
-- 
GitLab