aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex <[email protected]>2018-09-08 19:46:43 +0200
committerAlex <[email protected]>2018-09-08 19:46:43 +0200
commit770651333bfa3a498579c4a6b8129b49a2d1ee8c (patch)
treed8fd701ddbad5df25b82f06a61d35c90dd7e4797
parentf5a10287a7173524274e964a2f22f3c5a7bfe54b (diff)
downloadkerl-770651333bfa3a498579c4a6b8129b49a2d1ee8c.tar.gz
kerl-770651333bfa3a498579c4a6b8129b49a2d1ee8c.tar.bz2
kerl-770651333bfa3a498579c4a6b8129b49a2d1ee8c.zip
Added a tmp_dir var
-rwxr-xr-xkerl5
1 files 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)