diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-30 00:09:35 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-30 00:22:19 +0100 |
commit | 4d8368676ee914254b4864fb81113c0076d3102c (patch) | |
tree | 6e17290eb46f31c6911237dfc45d712ee7388d57 /virtual/miller-base | |
parent | Better av-scan (diff) | |
download | portage-4d8368676ee914254b4864fb81113c0076d3102c.tar.bz2 portage-4d8368676ee914254b4864fb81113c0076d3102c.tar.xz portage-4d8368676ee914254b4864fb81113c0076d3102c.zip |
Better hard linking ccaches
Uses ccache settings
Diffstat (limited to 'virtual/miller-base')
-rwxr-xr-x | virtual/miller-base/files/hardlink-ccache | 14 |
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 |