From: Alexander Barton Date: Thu, 24 Apr 2014 13:48:51 +0000 (+0200) Subject: Setup environment for local storage before reading in further scripts X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec6596cb61b24e1783920481d9e635abe867b6ea;p=ConfigScripts.git Setup environment for local storage before reading in further scripts --- diff --git a/sys/profile b/sys/profile index 15cee68..ca27bbb 100644 --- a/sys/profile +++ b/sys/profile @@ -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