From: Carl Hetherington Date: Thu, 10 Dec 2020 20:03:30 +0000 (+0100) Subject: Configurable temp dir. X-Git-Url: https://main.carlh.net/gitweb/?p=cdist.git;a=commitdiff_plain;h=9694c40d6d9aa888b8f71d068e05d30f38431314 Configurable temp dir. --- 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', '')