X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=cmd%2Fprune-older-cmd.py;h=96554233644b0bd789456627a31104834dc133a5;hb=d1291f927f680ba0a146ba3bb1fd23dec6c61066;hp=12a440a5cbf23964d7ce79e929a8602b684e243a;hpb=8caa0155662e1694f0b3ec415328f38466f3ed3c;p=bup.git diff --git a/cmd/prune-older-cmd.py b/cmd/prune-older-cmd.py index 12a440a..9655423 100755 --- a/cmd/prune-older-cmd.py +++ b/cmd/prune-older-cmd.py @@ -5,7 +5,7 @@ exec "$bup_python" "$0" ${1+"$@"} """ # end of bup preamble -from __future__ import print_function +from __future__ import absolute_import, print_function from collections import defaultdict from itertools import groupby from sys import stderr @@ -13,8 +13,10 @@ from time import localtime, strftime, time import re, sys from bup import git, options +from bup.compat import int_types from bup.gc import bup_gc from bup.helpers import die_if_errors, log, partition, period_as_secs +from bup.repo import LocalRepo from bup.rm import bup_rm @@ -84,8 +86,8 @@ opt, flags, roots = o.parse(sys.argv[1:]) if not opt.unsafe: o.fatal('refusing to run dangerous, experimental command without --unsafe') -now = int(time()) if not opt.wrt else opt.wrt -if not isinstance(now, (int, long)): +now = int(time()) if opt.wrt is None else opt.wrt +if not isinstance(now, int_types): o.fatal('--wrt value ' + str(now) + ' is not an integer') period_start = {} @@ -149,7 +151,8 @@ for branch, branch_id in branches(roots): if not opt.pretend: die_if_errors() - bup_rm(removals, compression=opt.compress, verbosity=opt.verbose) + repo = LocalRepo() + bup_rm(repo, removals, compression=opt.compress, verbosity=opt.verbose) if opt.gc: die_if_errors() bup_gc(threshold=opt.gc_threshold,