From: Brian Minton <
br...@minton.name>
Signed-off-by: Brian Minton <
br...@minton.name>
---
lib/bup/cmd/split.py | 14 ++++++++------
test/ext/test-split-join | 8 ++++++++
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/lib/bup/cmd/split.py b/lib/bup/cmd/split.py
index 11392e2..789266a 100755
--- a/lib/bup/cmd/split.py
+++ b/lib/bup/cmd/split.py
@@ -86,11 +86,12 @@ def main(argv):
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 not opt.quiet:
+ 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 +174,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 = \
diff --git a/test/ext/test-split-join b/test/ext/test-split-join
index 548f110..b68e344 100755
--- a/test/ext/test-split-join
+++ b/test/ext/test-split-join
@@ -22,6 +22,14 @@ WVPASS bup split --noop -b <"$top/test/testfile1" >tags1n.tmp
WVPASS bup split --noop -t <"$top/test/testfile2" >tags2tn.tmp
WVPASSEQ $(find "$BUP_DIR/objects/pack" -name '*.pack' | wc -l) 0
+WVSTART "split -q"
+WVPASS script -q -c "bup split -q -b <$top/test/testfile1 >tagsq.tmp" q.tmp
+WVPASS cp q.tmp /tmp
+WVPASS script -q -c "bup split -q -n quiet <$top/test/testfile1" q2.tmp
+WVPASS cp q2.tmp /tmp
+WVFAIL grep -q Splitting q.tmp
+WVFAIL grep -q Splitting q2.tmp
+
WVSTART "split"
WVPASS echo a >a.tmp
WVPASS echo b >b.tmp
--
2.30.2