From: Jo-Philipp Wich Date: Mon, 23 Jan 2017 13:21:41 +0000 (+0100) Subject: phase1: ccache.sh: avoid creating nested symlink X-Git-Tag: v1~193 X-Git-Url: http://git.openwrt.org/?p=buildbot.git;a=commitdiff_plain;h=7ce7c867e3c27bdbcf5c79cfc449feaf3f19b1f5 phase1: ccache.sh: avoid creating nested symlink Signed-off-by: Jo-Philipp Wich --- diff --git a/phase1/ccache.sh b/phase1/ccache.sh index 61590f2..46081f3 100755 --- a/phase1/ccache.sh +++ b/phase1/ccache.sh @@ -11,9 +11,11 @@ grep -sq compiler_check "$HOME/.ccache/ccache.conf" || \ echo "compiler_check = %compiler% -dumpmachine; %compiler% -dumpversion" >> "$HOME/.ccache/ccache.conf" for dir in $(make --no-print-directory val.TOOLCHAIN_DIR val.STAGING_DIR val.STAGING_DIR_HOST V=s | grep staging_dir/); do - mkdir -p "$dir" - test -L "$dir/ccache" || rm -rf "$dir/ccache" - ln -s "$HOME/.ccache" "$dir/ccache" + if [ ! -L "$dir/ccache" ]; then + mkdir -vp "$dir" + rm -vrf "$dir/ccache" + ln -vs "$HOME/.ccache" "$dir/ccache" + fi done ./staging_dir/host/bin/ccache -s 2>/dev/null