From 770651333bfa3a498579c4a6b8129b49a2d1ee8c Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 8 Sep 2018 19:46:43 +0200 Subject: Added a tmp_dir var --- kerl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kerl b/kerl index a7f1e0c..3455ee9 100755 --- a/kerl +++ b/kerl @@ -33,6 +33,7 @@ DOCSH_GITHUB_URL='https://github.com/erszcz/docsh.git' ERLANG_DOWNLOAD_URL='https://www.erlang.org/download' KERL_CONFIG_STORAGE_FILENAME='.kerl_config' +TMP_DIR=${TMP_DIR:-'/tmp'} if [ -z "$HOME" ]; then # shellcheck disable=SC2016 echo 'Error: $HOME is empty or not set.' 1>&2 @@ -213,7 +214,7 @@ get_git_releases() { } get_tarball_releases() { - tmp="$(mktemp /tmp/kerl.XXXXXX)" + tmp="$(mktemp ${TMP_DIR}/kerl.XXXXXX)" if [ 200 = "$(curl -qsL --output "$tmp" --write-out '%{http_code}' $ERLANG_DOWNLOAD_URL/)" ]; then sed $SED_OPT \ -e 's/^.*<[aA] [hH][rR][eE][fF]=\"otp_src_([-0-9A-Za-z_.]+)\.tar\.gz\">.*$/\1/' \ @@ -703,7 +704,7 @@ _do_build() { fi # Check to see if configuration options need to be stored or have changed - TMPOPT="/tmp/kerloptions.$$" + TMPOPT="${TMP_DIR}/kerloptions.$$" echo "$CFLAGS" >"$TMPOPT" echo "$KERL_CONFIGURE_OPTIONS" >>"$TMPOPT" SUM=$($MD5SUM "$TMPOPT" | cut -d ' ' -f $MD5SUM_FIELD) -- cgit v1.2.3 From f612d34e66786601be227ac5f9feaa50f6f611ad Mon Sep 17 00:00:00 2001 From: Awlexus Date: Sat, 8 Sep 2018 19:22:35 +0200 Subject: Mentioned the TMP_DIR variable --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 3c9ab83..3a87498 100644 --- a/README.md +++ b/README.md @@ -458,6 +458,11 @@ after activating a kerl installation of Erlang/OTP. Here is an example of # compilation options KERL_CONFIGURE_OPTIONS="--disable-native-libs --enable-vm-probes --with-dynamic-trace=dtrace --with-ssl=/usr/local --with-javac --enable-hipe --enable-kernel-poll --with-wx-config=/usr/local/bin/wxgtk2u-2.8-config --without-odbc --enable-threads --enable-sctp --enable-smp-support" + +In case you cannot access the default directory for temporary files (`/tmp`) or simply want them somewhere else, you can also provide your own directory with the variable `TMP_DIR` + + export TMP_DIR=/your/custom/temporary/dir + #### Building documentation Prior to kerl 1.0, kerl always downloaded prepared documentation from erlang.org. Now if `KERL_BUILD_DOCS=yes` is set, kerl will build the man pages and HTML -- cgit v1.2.3