diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-04-02 13:30:10 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-04-02 13:30:10 +0300 |
commit | e3dc1df8ba89da409fb3b813a4362bb7b74044a2 (patch) | |
tree | 8ebb069ce863c7fa034b08352c6a42a109b99cd9 | |
parent | 97761692af4e825208d8047c98394a9753b8d6a8 (diff) | |
download | obnam-benchmarks-e3dc1df8ba89da409fb3b813a4362bb7b74044a2.tar.gz |
Add --tmpdir
-rw-r--r-- | NEWS | 3 | ||||
-rwxr-xr-x | obbench | 9 |
2 files changed, 12 insertions, 0 deletions
@@ -4,6 +4,9 @@ NEWS file for obbench Version 0.15+git, not yet released ---------------------------------- +* Obbench now has the option `--tmpdir` to allow setting the location + of temporary directories. The `TMPDIR` environment variable is used, + if the option isn't (with a fallback to `/tmp` if neither is used). Version 0.15, released 2016-03-16 ---------------------------------- @@ -18,6 +18,7 @@ import os +import tempfile import cliapp import ttystatus @@ -35,11 +36,19 @@ class ObnamBenchmarker(cliapp.Application): metavar='DIR', default='.') self.settings.string( + ['tmpdir'], + 'use DIR for temporary files', + metavar='DIR', + default=tempfile.gettempdir()) + self.settings.string( ['publish-command'], 'after a successful run, run COMMAND', metavar='COMMAND') def process_args(self, args): + if self.settings['tmpdir']: + tempfile.tempdir = self.settings['tmpdir'] + spec = self.read_benchmark_spec(args[0]) statedir = self.create_state_directory() self.clone_or_update_git(statedir, spec) |