]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Setup environment for local storage before reading in further scripts
authorAlexander Barton <alex@barton.de>
Thu, 24 Apr 2014 13:48:51 +0000 (15:48 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 24 Apr 2014 13:48:51 +0000 (15:48 +0200)
sys/profile

index 15cee68c9434995a977006a726e42b38cc036f24..ca27bbbcfa0929b098f79ffe53b0b48bd1321786 100644 (file)
@@ -105,6 +105,17 @@ 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
+[ -w "/usr/local/home/$LOGNAME" ] \
+       && export LOCAL_HOME="/usr/local/home/$LOGNAME" \
+       || export LOCAL_HOME="$HOME"
+export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
+
+# Setup environment for ccache, if installed
+type -t ccache 2>/dev/null && export CCACHE_DIR="$XDG_CACHE_HOME/ccache"
+
 # Setup environment for Python "pip", if installed
 if [ "$(type -t pip 2>/dev/null)" ]; then
        export PIP_REQUIRE_VIRTUALENV=true
@@ -137,15 +148,6 @@ fi
 # read local profile, if available
 [ -r "/var/lib/${HOSTNAME}/profile" ] && . /var/lib/${HOSTNAME}/profile
 
-# 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
-if [ -w "/usr/local/home/$LOGNAME" ]; then
-       export LOCAL_HOME="/usr/local/home/$LOGNAME"
-       export CCACHE_DIR="$LOCAL_HOME/.ccache"
-       export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
-fi
-
 # interactive shell?
 [ "$PS1" ] || return