summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rwxr-xr-xobbench9
2 files changed, 12 insertions, 0 deletions
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
@@ -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)