summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-04-02 13:30:10 +0300
committerLars Wirzenius <liw@liw.fi>2016-04-02 13:30:10 +0300
commite3dc1df8ba89da409fb3b813a4362bb7b74044a2 (patch)
tree8ebb069ce863c7fa034b08352c6a42a109b99cd9
parent97761692af4e825208d8047c98394a9753b8d6a8 (diff)
downloadobnam-benchmarks-e3dc1df8ba89da409fb3b813a4362bb7b74044a2.tar.gz
Add --tmpdir
-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)