summaryrefslogtreecommitdiff
path: root/seivot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-06-25 15:08:35 +0100
committerLars Wirzenius <liw@liw.fi>2011-06-25 15:08:35 +0100
commit1244c103dca6d4240d9b7c72aad109ec70eaace5 (patch)
tree032baffcf9d233bb5784eb6f746fdcaf7d4798fe /seivot
parente58f82ed1b2d2781c8b764c037994981ae833c76 (diff)
downloadseivot-1244c103dca6d4240d9b7c72aad109ec70eaace5.tar.gz
Don't run viewprof on profiling files, but keep the original files.
Diffstat (limited to 'seivot')
-rwxr-xr-xseivot19
1 files changed, 5 insertions, 14 deletions
diff --git a/seivot b/seivot
index cc59e90..87d9a2c 100755
--- a/seivot
+++ b/seivot
@@ -159,25 +159,16 @@ class Obnam(BackupProgram):
'--weak-random']
env = dict(os.environ)
if self.settings['obnam-profile']:
- fd, env['OBNAM_PROFILE'] = tempfile.mkstemp()
- os.close(fd)
+ namepattern = {
+ 'gen': str(nth_gen),
+ 'op': args[0],
+ }
+ env['OBNAM_PROFILE'] = self.settings['obnam-profile'] % namepattern
if self._larch_branch:
env['PYTHONPATH'] = self._larch_branch
if self.settings['encrypt-with']:
cmd += ['--encrypt-with', self.settings['encrypt-with']]
result = runcmd(cmd + args, cwd=self._branch, env=env, **kwargs)
- if self.settings['obnam-profile']:
- namepattern = {
- 'gen': str(nth_gen),
- 'op': args[0],
- }
- for order in ['cumulative', 'time']:
- namepattern['order'] = order
- name = self.settings['obnam-profile'] % namepattern
- f = open(name, 'w')
- runcmd(['viewprof', env['OBNAM_PROFILE'], order], stdout=f)
- f.close()
- os.remove(env['OBNAM_PROFILE'])
self.extract_repository_io(result[0], logfile)