From 4d8368676ee914254b4864fb81113c0076d3102c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 30 Sep 2020 00:09:35 +0100 Subject: Better hard linking ccaches Uses ccache settings --- virtual/miller-base/files/hardlink-ccache | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'virtual/miller-base') diff --git a/virtual/miller-base/files/hardlink-ccache b/virtual/miller-base/files/hardlink-ccache index afee96c..037dd64 100755 --- a/virtual/miller-base/files/hardlink-ccache +++ b/virtual/miller-base/files/hardlink-ccache @@ -1,12 +1,14 @@ #!/bin/bash -getent passwd | cut -d: -f6 | sort -u | while read h ; do - CCACHE_BASEDIR=$h/.ccache - if [[ -e $CCACHE_BASEDIR ]] ; then - realpath $CCACHE_BASEDIR +getent passwd | cut -d: -f1,6 | while IFS=: read u h ; do + if [[ -d $h/.ccache ]] ; then + CCACHE_BASEDIR=$(sudo -u $u ccache -k cache_dir) + if [[ -e $CCACHE_BASEDIR ]] ; then + realpath $CCACHE_BASEDIR + fi fi done | sort -u | while read d ; do - echo "Hard linking $d..." - hardlink -mopt $d + echo "Hard linking $d..." + hardlink -mopt $d done -- cgit v1.2.3