summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-10 21:03:30 +0100
committerCarl Hetherington <cth@carlh.net>2020-12-10 21:03:30 +0100
commit3f190e27e9520101bc0bf4cd977f800da0a0be33 (patch)
tree684ea1b8078ec0deeacaf2fce340e51e38a82c44
parent7dda4af7ae0fe7f8d218ac25d0a9e804b3bce852 (diff)
Configurable temp dir.
-rwxr-xr-xcdist7
1 files changed, 3 insertions, 4 deletions
diff --git a/cdist b/cdist
index a82c188..68ff417 100755
--- a/cdist
+++ b/cdist
@@ -35,8 +35,6 @@ import sys
import tempfile
import time
-TEMPORARY_DIRECTORY = '/var/tmp'
-
class Error(Exception):
def __init__(self, value):
self.value = value
@@ -122,7 +120,8 @@ class Config:
BoolOption('docker_no_user'),
Option('docker_hub_repository'),
Option('flatpak_state_dir'),
- Option('parallel', multiprocessing.cpu_count()) ]
+ Option('parallel', multiprocessing.cpu_count()),
+ Option('temp', '/var/tmp')]
config_dir = '%s/.config' % os.path.expanduser('~')
if not os.path.exists(config_dir):
@@ -414,7 +413,7 @@ class Target(object):
self.build_dependencies = True
if directory is None:
- self.directory = tempfile.mkdtemp('', 'tmp', TEMPORARY_DIRECTORY)
+ self.directory = tempfile.mkdtemp('', 'tmp', config.get('temp'))
self.rmdir = True
self.set('CCACHE_BASEDIR', os.path.realpath(self.directory))
self.set('CCACHE_NOHASHDIR', '')