3 # https://sourceware.org/bugzilla/show_bug.cgi?id=26034
4 export "BUP_ARGV_0"="$0"
7 export "BUP_ARGV_${arg_i}"="$arg"
11 # Here to end of preamble replaced during install
12 bup_python="$(dirname "$0")/bup-python" || exit $?
13 exec "$bup_python" "$0"
17 from __future__ import absolute_import
20 from bup import compat, git, options
21 from bup.gc import bup_gc
22 from bup.helpers import die_if_errors, handle_ctrl_c, log
28 v,verbose increase log output (can be used more than once)
29 threshold= only rewrite a packfile if it's over this percent garbage [10]
30 #,compress= set compression level to # (0-9, 9 is highest) [1]
31 unsafe use the command even though it may be DANGEROUS
35 # FIXME: make sure client handles server-side changes reasonably
39 o = options.Options(optspec)
40 opt, flags, extra = o.parse(compat.argv[1:])
43 o.fatal('refusing to run dangerous, experimental command without --unsafe')
46 o.fatal('no positional parameters expected')
50 opt.threshold = int(opt.threshold)
52 o.fatal('threshold must be an integer percentage value')
53 if opt.threshold < 0 or opt.threshold > 100:
54 o.fatal('threshold must be an integer percentage value')
56 git.check_repo_or_die()
58 bup_gc(threshold=opt.threshold,
59 compression=opt.compress,
60 verbosity=opt.verbose)