From e49ca4c908646711e3a34cbc6f75a4338362ae48 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 26 Apr 2014 17:21:23 +0200 Subject: [PATCH] Only try to create local home directory if /usr/local/home already exists --- sys/profile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/profile b/sys/profile index 368d07e..a190bd7 100644 --- a/sys/profile +++ b/sys/profile @@ -105,12 +105,14 @@ fi [ -n "$HOSTNAME" ] || HOSTNAME=`hostname 2>/dev/null` export HOSTNAME -# Setup some directories to use local storage (no NFS) -[ -d "/usr/local/home/$LOGNAME" ] \ - || ( mkdir /usr/local/home; mkdir "/usr/local/home/$LOGNAME" ) >/dev/null 2>&1 +# Setup local home directory, when available +[ -d "/usr/local/home" -a ! -d "/usr/local/home/$LOGNAME" ] \ + && mkdir "/usr/local/home/$LOGNAME" >/dev/null 2>&1 [ -w "/usr/local/home/$LOGNAME" ] \ && export LOCAL_HOME="/usr/local/home/$LOGNAME" \ || export LOCAL_HOME="$HOME" + +# Setup environment to use local storage (no NFS, if possible!) export XDG_CACHE_HOME="$LOCAL_HOME/.cache" # Setup environment for ccache, if installed -- 2.39.2