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