Thanks to Brian Minton for reporting the issue.
Signed-off-by: Rob Browning <
r...@defaultvalue.org>
---
Proposed.
lib/bup/cmd/split.py | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/lib/bup/cmd/split.py b/lib/bup/cmd/split.py
index 11392e20..f1699b53 100755
--- a/lib/bup/cmd/split.py
+++ b/lib/bup/cmd/split.py
@@ -82,15 +82,19 @@ def main(argv):
else:
date = time.time()
- # Hack around lack of nonlocal vars in python 2
- total_bytes = [0]
- def prog(filenum, nbytes):
- total_bytes[0] += nbytes
- if filenum > 0:
- qprogress('Splitting: file #%d, %d kbytes\r'
- % (filenum+1, total_bytes[0] // 1024))
- else:
- qprogress('Splitting: %d kbytes\r' % (total_bytes[0] // 1024))
+ if opt.quiet:
+ def prog(filenum, nbytes):
+ pass
+ else:
+ # Hack around lack of nonlocal vars in python 2
+ total_bytes = [0]
+ def prog(filenum, nbytes):
+ total_bytes[0] += nbytes
+ if filenum > 0:
+ qprogress('Splitting: file #%d, %d kbytes\r'
+ % (filenum+1, total_bytes[0] // 1024))
+ else:
+ qprogress('Splitting: %d kbytes\r' % (total_bytes[0] // 1024))
is_reverse = environ.get(b'BUP_SERVER_REVERSE')
@@ -173,7 +177,8 @@ def main(argv):
progress=prog)
for (sha, size, level) in shalist:
out.write(hexlify(sha) + b'\n')
- reprogress()
+ if not opt.quiet:
+ reprogress()
elif opt.tree or opt.commit or
opt.name:
if
opt.name: # insert dummy_name which may be used as a restore target
mode, sha = \
--
2.30.2