summaryrefslogtreecommitdiff
path: root/virtual/miller-base
diff options
context:
space:
mode:
Diffstat (limited to 'virtual/miller-base')
-rwxr-xr-xvirtual/miller-base/files/hardlink-ccache14
1 files changed, 8 insertions, 6 deletions
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