From e3dc1df8ba89da409fb3b813a4362bb7b74044a2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 2 Apr 2016 13:30:10 +0300 Subject: Add --tmpdir --- NEWS | 3 +++ obbench | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/NEWS b/NEWS index 6319c02..9e3003b 100644 --- a/NEWS +++ b/NEWS @@ -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 ---------------------------------- diff --git a/obbench b/obbench index 9172457..95132b7 100755 --- a/obbench +++ b/obbench @@ -18,6 +18,7 @@ import os +import tempfile import cliapp import ttystatus @@ -34,12 +35,20 @@ class ObnamBenchmarker(cliapp.Application): 'keep state in DIR between runs', 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) -- cgit v1.2.1