3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
8 from __future__ import absolute_import
11 from bup import git, options
12 from bup.gc import bup_gc
13 from bup.helpers import die_if_errors, handle_ctrl_c, log
19 v,verbose increase log output (can be used more than once)
20 threshold= only rewrite a packfile if it's over this percent garbage [10]
21 #,compress= set compression level to # (0-9, 9 is highest) [1]
22 unsafe use the command even though it may be DANGEROUS
26 # FIXME: make sure client handles server-side changes reasonably
30 o = options.Options(optspec)
31 (opt, flags, extra) = o.parse(sys.argv[1:])
34 o.fatal('refusing to run dangerous, experimental command without --unsafe')
37 o.fatal('no positional parameters expected')
41 opt.threshold = int(opt.threshold)
43 o.fatal('threshold must be an integer percentage value')
44 if opt.threshold < 0 or opt.threshold > 100:
45 o.fatal('threshold must be an integer percentage value')
47 git.check_repo_or_die()
49 bup_gc(threshold=opt.threshold,
50 compression=opt.compress,
51 verbosity=opt.verbose)