]> arthur.barton.de Git - bup.git/commitdiff
Streamline output: Debug, error, progress, and log messages
authorAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 17:30:35 +0000 (18:30 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 17:49:03 +0000 (18:49 +0100)
All messages should start with a capital letter and contain complete
and correct punctuation.

Signed-off-by: Alexander Barton <alex@barton.de>
31 files changed:
cmd/bloom-cmd.py
cmd/daemon-cmd.py
cmd/damage-cmd.py
cmd/fsck-cmd.py
cmd/ftp-cmd.py
cmd/fuse-cmd.py
cmd/index-cmd.py
cmd/init-cmd.py
cmd/join-cmd.py
cmd/list-idx-cmd.py
cmd/memtest-cmd.py
cmd/midx-cmd.py
cmd/mux-cmd.py
cmd/random-cmd.py
cmd/restore-cmd.py
cmd/save-cmd.py
cmd/server-cmd.py
cmd/split-cmd.py
cmd/tag-cmd.py
cmd/web-cmd.py
lib/bup/bloom.py
lib/bup/client.py
lib/bup/drecurse.py
lib/bup/git.py
lib/bup/helpers.py
lib/bup/index.py
lib/bup/ls.py
lib/bup/metadata.py
lib/bup/midx.py
lib/bup/options.py
main.py

index c5a3e7e47ccd1072ee641307f2636fbd219f4c87..a79c7710c13b1fa9148efc13ef5c6d0fc631427b 100755 (executable)
@@ -19,7 +19,7 @@ def ruin_bloom(bloomfilename):
     rbloomfilename = git.repo_rel(bloomfilename)
     if not os.path.exists(bloomfilename):
         log(bloomfilename)
-        add_error("bloom: %s not found to ruin" % rbloomfilename)
+        add_error("Bloom filter: %s not found to ruin!" % rbloomfilename)
         return
     b = bloom.ShaBloom(bloomfilename, readwrite=True, expected=1)
     b.map[16:16+2**b.bits] = '\0' * 2**b.bits
@@ -29,23 +29,23 @@ def check_bloom(path, bloomfilename, idx):
     rbloomfilename = git.repo_rel(bloomfilename)
     ridx = git.repo_rel(idx)
     if not os.path.exists(bloomfilename):
-        log("bloom: %s: does not exist." % rbloomfilename)
+        add_error("Error: %s does not exist!" % rbloomfilename)
         return
     b = bloom.ShaBloom(bloomfilename)
     if not b.valid():
-        add_error("bloom: %r is invalid." % rbloomfilename)
+        add_error("Error: %r is invalid!" % rbloomfilename)
         return
     base = os.path.basename(idx)
     if base not in b.idxnames:
-        log("bloom: %s does not contain the idx." % rbloomfilename)
+        add_error("Error: %s does not contain the idx!" % rbloomfilename)
         return
     if base == idx:
         idx = os.path.join(path, idx)
-    log("bloom: bloom file: %s" % rbloomfilename)
-    log("bloom:   checking %s" % ridx)
+    log("Checking bloom file: %s" % rbloomfilename)
+    log("  checking %s" % ridx)
     for objsha in git.open_idx(idx):
         if not b.exists(objsha):
-            add_error("bloom: ERROR: object %s missing" 
+            add_error("Error: Object %s is missing!"
                       % str(objsha).encode('hex'))
 
 
@@ -56,7 +56,7 @@ def do_bloom(path, outfilename):
     if os.path.exists(outfilename) and not opt.force:
         b = bloom.ShaBloom(outfilename)
         if not b.valid():
-            debug1("bloom: Existing invalid bloom found, regenerating.")
+            debug1("Bloom filter: Existing invalid item found, regenerating ...")
             b = None
 
     add = []
@@ -64,7 +64,7 @@ def do_bloom(path, outfilename):
     add_count = 0
     rest_count = 0
     for i,name in enumerate(glob.glob('%s/*.idx' % path)):
-        progress_update('bloom: counting (%d) ...' % i)
+        progress_update('Bloom filter: Counting (%d) ...' % i)
         ix = git.open_idx(name)
         ixbase = os.path.basename(name)
         if b and (ixbase in b.idxnames):
@@ -76,18 +76,18 @@ def do_bloom(path, outfilename):
     total = add_count + rest_count
 
     if not add:
-        debug1("bloom: nothing to do.")
+        debug1("Bloom filter: Nothing to do.")
         return
 
     if b:
         if len(b) != rest_count:
-            debug1("bloom: size %d != idx total %d, regenerating"
+            debug1("Bloom filter: size %d != idx total %d, regenerating ..."
                    % (len(b), rest_count))
             b = None
         elif (b.bits < bloom.MAX_BLOOM_BITS and
               b.pfalse_positive(add_count) > bloom.MAX_PFALSE_POSITIVE):
-            debug1("bloom: regenerating: adding %d entries gives "
-                   "%.2f%% false positives.\n"
+            debug1("Bloom filter: Adding %d entries gives %.2f%% "
+                   "false positives, regenerating ..."
                    % (add_count, b.pfalse_positive(add_count)))
             b = None
         else:
@@ -98,10 +98,10 @@ def do_bloom(path, outfilename):
     del rest
     del rest_count
 
-    msg = b is None and 'creating from' or 'adding'
+    msg = b is None and 'Creating from' or 'Adding'
     if not _first: _first = path
     dirprefix = (_first != path) and git.repo_rel(path)+': ' or ''
-    progress_update('bloom: %s%s %d file%s (%d object%s) ...'
+    progress_update('Bloom filter: %s%s %d file%s (%d object%s) ...'
         % (dirprefix, msg,
            len(add), len(add)!=1 and 's' or '',
            add_count, add_count!=1 and 's' or ''))
@@ -114,7 +114,7 @@ def do_bloom(path, outfilename):
     icount = 0
     for name in add:
         ix = git.open_idx(name)
-        progress_update('bloom: writing %.2f%% (%d/%d objects) ...'
+        progress_update('Bloom filter: Writing %.2f%% (%d/%d objects) ...'
                   % (icount*100.0/add_count, icount, add_count))
         b.add_idx(ix)
         count += 1
@@ -127,7 +127,7 @@ def do_bloom(path, outfilename):
     if tfname:
         os.rename(tfname, outfilename)
 
-    progress_end('bloom: %s%s %d file%s (%d object%s), done.'
+    progress_end('Bloom filter: %s%s %d file%s (%d object%s), done.'
         % (dirprefix, msg,
            len(add), len(add)!=1 and 's' or '',
            add_count, add_count!=1 and 's' or ''))
@@ -148,7 +148,7 @@ if not opt.check and opt.k and opt.k not in (4,5):
 
 paths = opt.dir and [opt.dir] or git.all_packdirs()
 for path in paths:
-    debug1('bloom: scanning %s' % path)
+    debug1('Bloom filter: Scanning %s ...' % path)
     outfilename = opt.output or os.path.join(path, 'bup.bloom')
     if opt.check:
         check_bloom(path, outfilename, opt.check)
index d25e4d89de5e5401570a68f24b3c0799c7512cd5..4086517a49c5e3cdd200a4c1ada465390839476e 100755 (executable)
@@ -29,9 +29,9 @@ for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
         continue
     try:
         if af == socket.AF_INET6:
-            log("bup daemon: listening on [%s]:%s" % sa[:2])
+            log("Listening on [%s]:%s." % sa[:2])
         else:
-            log("bup daemon: listening on %s:%s" % sa[:2])
+            log("Listening on %s:%s." % sa[:2])
         s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         s.bind(sa)
         s.listen(1)
@@ -42,7 +42,7 @@ for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
     socks.append(s)
 
 if not socks:
-    log('bup daemon: listen socket: %s' % e.args[1])
+    log('Listen socket: %s' % e.args[1])
     sys.exit(1)
 
 try:
@@ -51,7 +51,7 @@ try:
         for l in rl:
             s, src = l.accept()
             try:
-                log("Socket accepted connection from %s" % (src,))
+                log("Socket accepted connection from %s ..." % (src,))
                 fd1 = os.dup(s.fileno())
                 fd2 = os.dup(s.fileno())
                 s.close()
@@ -66,4 +66,4 @@ finally:
         l.shutdown(socket.SHUT_RDWR)
         l.close()
 
-debug1("bup daemon: done")
+debug1("bup daemon done.")
index 26be9ad1d57a6f72d83810c8a784c18d8113c1d3..4e951bf9e12d3467fb92a9a76777d0ce537c0e89 100755 (executable)
@@ -31,7 +31,7 @@ if opt.seed != None:
     random.seed(opt.seed)
 
 for name in extra:
-    log('Damaging "%s"...' % name)
+    log('Damaging "%s" ...' % name)
     f = open(name, 'r+b')
     st = os.fstat(f.fileno())
     size = st.st_size
index 233371e25a28799009b924598262598bcf2ae8dd..28b37bcef237379e1655f308a33fa1b691b5378a 100755 (executable)
@@ -30,7 +30,7 @@ def par2_setup():
                              stdout=nullf, stderr=nullf, stdin=nullf)
         rv = p.wait()
     except OSError:
-        log('fsck: warning: par2 not found; disabling recovery features.')
+        log('fsck: Warning: "par2" not found; disabling recovery features!')
     else:
         par2_ok = 1
 
@@ -72,7 +72,7 @@ def git_verify(base):
         try:
             quick_verify(base)
         except Exception, e:
-            debug('error: %s' % e)
+            debug('Error: %s!' % e)
             return 1
         return 0
     else:
@@ -88,15 +88,15 @@ def do_pack(base, last, par2_exists):
                 rresult = par2_repair(base)
                 if rresult != 0:
                     action_result = 'failed'
-                    log('%s par2 repair: failed (%d)' % (last, rresult))
+                    log('%s par2 repair: Failed (%d)!' % (last, rresult))
                     code = rresult
                 else:
                     action_result = 'repaired'
-                    log('%s par2 repair: succeeded (0)' % last)
+                    log('%s par2 repair: Succeeded (0).' % last)
                     code = 100
             else:
                 action_result = 'failed'
-                log('%s par2 verify: failed (%d)' % (last, vresult))
+                log('%s par2 verify: Failed (%d)!' % (last, vresult))
                 code = vresult
         else:
             action_result = 'ok'
@@ -104,14 +104,14 @@ def do_pack(base, last, par2_exists):
         gresult = git_verify(base)
         if gresult != 0:
             action_result = 'failed'
-            log('%s git verify: failed (%d)' % (last, gresult))
+            log('%s Git verify: Failed (%d)!' % (last, gresult))
             code = gresult
         else:
             if par2_ok and opt.generate:
                 presult = par2_generate(base)
                 if presult != 0:
                     action_result = 'failed'
-                    log('%s par2 create: failed (%d)' % (last, presult))
+                    log('%s par2 create: Failed (%d)!' % (last, presult))
                     code = presult
                 else:
                     action_result = 'generated'
@@ -173,7 +173,7 @@ for name in extra:
     if par2_exists and os.stat(base + '.par2').st_size == 0:
         par2_exists = 0
     sys.stdout.flush()
-    debug('fsck: checking %s (%s)'
+    debug('fsck: Checking %s (%s) ...'
           % (last, par2_ok and par2_exists and 'par2' or 'git'))
     if not opt.verbose:
         progress_update('fsck (%d/%d) ...' % (count + 1, len(extra)))
@@ -197,7 +197,7 @@ for name in extra:
             try:
                 sys.exit(do_pack(base, last, par2_exists))
             except Exception, e:
-                log('exception: %r' % e)
+                log('Exception: %r' % e)
                 sys.exit(99)
                 
 while len(outstanding):
index ca90ce2619dcda424d7728f7026cd5c0e0b9471a..620e24741f5e61d94d348454b5ac881723abb1ed 100755 (executable)
@@ -138,7 +138,7 @@ else:
     try:
         import readline
     except ImportError:
-        log('* readline module not available: line editing disabled.')
+        log('* "readline" module not available: Line editing disabled.')
         readline = None
 
     if readline:
@@ -195,7 +195,7 @@ for line in lines:
                             outf.close()
                         except Exception, e:
                             rv = 1
-                            log('  error: %s' % e)
+                            log('  error: %s!' % e)
         elif cmd == 'help' or cmd == '?':
             log('Commands: ls cd pwd cat get mget help quit')
         elif cmd == 'quit' or cmd == 'exit' or cmd == 'bye':
@@ -205,7 +205,7 @@ for line in lines:
             raise Exception('no such command %r' % cmd)
     except Exception, e:
         rv = 1
-        log('error: %s' % e)
+        log('Error: %s!' % e)
         #raise
 
 sys.exit(rv)
index b84874ca35fbaf94f17a5e40ca8c6b2ddf1e7b69..a19b69a40aefdaddb745f1a81009048c6a433d99 100755 (executable)
@@ -5,7 +5,7 @@ from bup.helpers import *
 try:
     import fuse
 except ImportError:
-    log('error: cannot find the python "fuse" module; please install it')
+    log('Error: Cannot find the python "fuse" module; please install it!')
     sys.exit(1)
 
 
index 551d8064a85e4ad9a3b4b5cabdaf4e7355081d94..3bbb5be03c83a76a13d7d8adbbf3ae104875b386 100755 (executable)
@@ -21,7 +21,7 @@ class IterHelper:
 
 def check_index(reader):
     try:
-        log('check: checking forward iteration...')
+        log('Testing forward iteration ...')
         e = None
         d = {}
         for e in reader.forward_iter():
@@ -37,16 +37,16 @@ def check_index(reader):
                 assert(e.sha != index.EMPTY_SHA)
                 assert(e.gitmode)
         assert(not e or e.name == '/')  # last entry is *always* /
-        log('check: checking normal iteration...')
+        log('Testing normal iteration ...')
         last = None
         for e in reader:
             if last:
                 assert(last > e.name)
             last = e.name
     except:
-        log('index error! at %r' % e)
+        log('Index error at %r!' % e)
         raise
-    log('check: passed.')
+    log('Check passed.')
 
 
 def clear_index(indexfile):
@@ -56,7 +56,7 @@ def clear_index(indexfile):
         try:
             os.remove(path)
             if opt.verbose:
-                log('clear: removed %s' % path)
+                log('Removed "%s".' % path)
         except OSError, e:
             if e.errno != errno.ENOENT:
                 raise
@@ -165,9 +165,9 @@ def update_index(top, excluded_paths, exclude_rxs):
         if wi.count:
             wr = wi.new_reader()
             if opt.check:
-                log('check: before merging: oldfile')
+                log('Check before merging: oldfile ...')
                 check_index(ri)
-                log('check: before merging: newfile')
+                log('Check before merging: newfile ...')
                 check_index(wr)
             mi = index.Writer(indexfile, msw, tmax)
 
@@ -240,11 +240,11 @@ indexfile = opt.indexfile or git.repo('bupindex')
 handle_ctrl_c()
 
 if opt.check:
-    log('check: starting initial check.')
+    log('Starting initial index check ...')
     check_index(index.Reader(indexfile))
 
 if opt.clear:
-    log('clear: clearing index.')
+    log('Clearing index ...')
     clear_index(indexfile)
 
 excluded_paths = parse_excludes(flags, o.fatal)
index 2e4a1513b99c058a1fec43ba0e62091d3ed2158d..49005d7c53bdaf0a144c77b76614e8e757ab7681 100755 (executable)
@@ -20,7 +20,7 @@ if extra:
 try:
     git.init_repo()  # local repo
 except git.GitError, e:
-    log("bup: error: could not init repository: %s" % e)
+    log("Cannot initialize repository: %s!" % e)
     sys.exit(1)
 
 if opt.remote:
index c99dc1930bad95f331d0a4ee75a915f51c56309f..7bf89963890e86e2e35878ff7e59647464fc372b 100755 (executable)
@@ -38,7 +38,7 @@ for id in extra:
             outfile.write(blob)
     except KeyError, e:
         outfile.flush()
-        log('error: %s' % e)
+        log('Error: %s!' % e)
         ret = 1
 
 sys.exit(ret)
index 208cd03d2985ec4318f96e7b244774429f5312cd..43f6b06959b5a507d372fe821d94d95fd3036df5 100755 (executable)
@@ -36,7 +36,7 @@ for name in extra:
     try:
         ix = git.open_idx(name)
     except git.GitError, e:
-        add_error('%s: %s' % (name, e))
+        add_error('%s: %s!' % (name, e))
         continue
     if len(opt.find) == 40:
         if ix.exists(bin):
index 05ab6891f7404a84c67f96897faadb0a7390bba6..725e764dcac04788592919e791da60ba04bcd2e3 100755 (executable)
@@ -14,7 +14,7 @@ def linux_memstat():
         f = open('/proc/self/status')
     except IOError, e:
         if not _linux_warned:
-            log('Warning: %s' % e)
+            log('Warning: %s!' % e)
             _linux_warned = 1
         return {}
     for line in f:
@@ -104,15 +104,15 @@ for c in xrange(opt.cycles):
     report((c+1)*opt.number)
 
 if bloom._total_searches:
-    print ('bloom: %d objects searched in %d steps: avg %.3f steps/object
+    print ('bloom: %d objects searched in %d steps: avg %.3f steps/object.'
            % (bloom._total_searches, bloom._total_steps,
               bloom._total_steps*1.0/bloom._total_searches))
 if midx._total_searches:
-    print ('midx: %d objects searched in %d steps: avg %.3f steps/object
+    print ('midx: %d objects searched in %d steps: avg %.3f steps/object.'
            % (midx._total_searches, midx._total_steps,
               midx._total_steps*1.0/midx._total_searches))
 if git._total_searches:
-    print ('idx: %d objects searched in %d steps: avg %.3f steps/object
+    print ('idx: %d objects searched in %d steps: avg %.3f steps/object.'
            % (git._total_searches, git._total_steps,
               git._total_steps*1.0/git._total_searches))
-print 'Total time: %.3fs' % (time.time() - start)
+print 'Total time: %.3fs.' % (time.time() - start)
index 7ae8e4241191b0b78368d82cbcebfc52e6ccc455..56a3249706cd424ad1779a50a733c2e625c464a1 100755 (executable)
@@ -42,7 +42,7 @@ def check_midx(name):
     try:
         ix = git.open_idx(name)
     except git.GitError, e:
-        add_error('%s: %s' % (name, e))
+        add_error('%s: %s!' % (name, e))
         return
     for count,subname in enumerate(ix.idxnames):
         sub = git.open_idx(os.path.join(os.path.dirname(name), subname))
@@ -52,11 +52,11 @@ def check_midx(name):
                           % (count, len(ix.idxnames),
                              git.shorten_hash(subname), ecount, len(sub)), False)
             if not sub.exists(e):
-                add_error("%s: %s: %s missing from idx"
+                add_error("%s: %s: %s missing from idx!"
                           % (nicename, git.shorten_hash(subname),
                              str(e).encode('hex')))
             if not ix.exists(e):
-                add_error("%s: %s: %s missing from midx"
+                add_error("%s: %s: %s missing from midx!"
                           % (nicename, git.shorten_hash(subname),
                              str(e).encode('hex')))
     prev = None
@@ -64,7 +64,7 @@ def check_midx(name):
         if not (ecount % 1234):
             progress_update('  Ordering: %d/%d ...' % (ecount, len(ix)), False)
         if not e >= prev:
-            add_error('%s: ordering error: %s < %s'
+            add_error('%s: Ordering error: %s < %s!'
                       % (nicename,
                          str(e).encode('hex'), str(prev).encode('hex')))
         prev = e
@@ -100,18 +100,18 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr):
 
         if not _first: _first = outdir
         dirprefix = (_first != outdir) and git.repo_rel(outdir)+': ' or ''
-        debug1('midx: %s%screating from %d files (%d objects).'
+        debug1('Multi-index: %s%screating from %d files (%d objects) ...'
                % (dirprefix, prefixstr, len(infilenames), total))
         if (opt.auto and (total < 1024 and len(infilenames) < 3)) \
            or ((opt.auto or opt.force) and len(infilenames) < 2) \
            or (opt.force and not total):
-            debug1('midx: nothing to do.')
+            debug1('Multi-index: Nothing to do.')
             return
 
         pages = int(total/SHA_PER_PAGE) or 1
         bits = int(math.ceil(math.log(pages, 2)))
         entries = 2**bits
-        debug1('midx: table size: %d (%d bits)' % (entries*4, bits))
+        debug1('Multi-index: Table size %d (%d bits).' % (entries*4, bits))
 
         unlink(outfilename)
         with atomically_replaced_file(outfilename, 'wb') as f:
@@ -181,7 +181,7 @@ def do_midx_dir(path):
                     already[iname] = 1
                     any = 1
             if not any:
-                debug1('%r is redundant' % mname)
+                debug1('%r is redundant!' % mname)
                 unlink(mname)
                 already[mname] = 1
 
@@ -198,17 +198,17 @@ def do_midx_dir(path):
     DESIRED_HWM = opt.force and 1 or 5
     DESIRED_LWM = opt.force and 1 or 2
     existed = dict((name,1) for sz,name in all)
-    debug1('midx: %d indexes; want no more than %d.'
+    debug1('Multi-index: %d indexes; want no more than %d.'
            % (len(all), DESIRED_HWM))
     if len(all) <= DESIRED_HWM:
-        debug1('midx: nothing to do.')
+        debug1('Multi-index: Nothing to do.')
     while len(all) > DESIRED_HWM:
         all.sort()
         part1 = [name for sz,name in all[:len(all)-DESIRED_LWM+1]]
         part2 = all[len(all)-DESIRED_LWM+1:]
         all = list(do_midx_group(path, part1)) + part2
         if len(all) > DESIRED_HWM:
-            debug1('Still too many indexes (%d > %d).  Merging again.'
+            debug1('Still too many indexes (%d > %d). Merging again ...'
                    % (len(all), DESIRED_HWM))
 
     if opt['print']:
@@ -252,7 +252,7 @@ if opt.check:
         midxes = []
         paths = opt.dir and [opt.dir] or git.all_packdirs()
         for path in paths:
-            debug1('midx: scanning %s' % path)
+            debug1('Multi-index: Scanning %s ...' % path)
             midxes += glob.glob(os.path.join(path, '*.midx'))
     for name in midxes:
         check_midx(name)
@@ -264,7 +264,7 @@ else:
     elif opt.auto or opt.force:
         paths = opt.dir and [opt.dir] or git.all_packdirs()
         for path in paths:
-            debug1('midx: scanning %s' % path)
+            debug1('Multi-index: scanning %s ...' % path)
             do_midx_dir(path)
     else:
         o.fatal("you must use -f or -a or provide input filenames")
index 0fbefb39ca969cb754ba05f441b38efc8689b6b2..00e41ea25d759df16d6e357019b82bfcb9e681fd 100755 (executable)
@@ -14,7 +14,7 @@ if len(extra) < 1:
 
 subcmd = extra
 
-debug2('bup mux: starting %r' % (extra,))
+debug2('bup mux: Starting "%r" ...' % (extra,))
 
 outr, outw = os.pipe()
 errr, errw = os.pipe()
@@ -32,8 +32,8 @@ os.close(errr)
 prv = p.wait()
 
 if prv:
-    debug1('%s exited with code %d' % (extra[0], prv))
+    debug1('bup mux: %s exited with code %d!' % (extra[0], prv))
 
-debug1('bup mux: done')
+debug1('bup mux: Done (%d).' % prv)
 
 sys.exit(prv)
index deebcde558822e5d3615421bf30592adb1cc2efd..445d7dd45dd2aba946da1962c9144ba9c98c6bf5 100755 (executable)
@@ -25,5 +25,5 @@ if opt.force or (not os.isatty(1) and
     _helpers.write_random(sys.stdout.fileno(), total, opt.seed,
                           opt.verbose and 1 or 0)
 else:
-    log('error: not writing binary data to a terminal. Use -f to force.')
+    log('Error: Not writing binary data to a terminal. Use -f to force.')
     sys.exit(1)
index 0ce0a61319440b4774ad442c9748a68b4216c2bd..a9806999932a8f8759a3332d558be5faf03cfe7b 100755 (executable)
@@ -305,7 +305,7 @@ if opt.outdir:
 ret = 0
 for d in extra:
     if not valid_restore_path(d):
-        add_error("ERROR: path %r doesn't include a branch and revision" % d)
+        add_error("Error: Path %r doesn't include a branch and revision!" % d)
         continue
     path,name = os.path.split(d)
     try:
@@ -320,7 +320,7 @@ for d in extra:
         # (i.e. /foo/what/ever/.), then also restore what/ever's
         # metadata to the current directory.
         if not isdir:
-            add_error('%r: not a directory' % d)
+            add_error('%r: Not a directory!' % d)
         else:
             do_root(n, opt.sparse, owner_map, restore_root_meta = (name == '.'))
     else:
index 1b3eff3fb5d527f9e4178fc74a8e920404af8260..7a9bb2dc5289d8d4d24decc6bba972b1cd9b8ccf 100755 (executable)
@@ -77,7 +77,7 @@ if opt.remote or is_reverse:
     try:
         cli = client.Client(opt.remote)
     except client.ClientError, e:
-        log('error: %s' % e)
+        log('Error: %s!' % e)
         sys.exit(1)
     oldref = refname and cli.read_ref(refname) or None
     w = cli.new_packwriter(compression_level=opt.compress)
@@ -196,7 +196,7 @@ try:
 except IOError, ex:
     if ex.errno != EACCES:
         raise
-    log('error: cannot access %r; have you run bup index?' % indexfile)
+    log('Error: Cannot access %r; have you run bup index?' % indexfile)
     sys.exit(1)
 hlink_db = hlinkdb.HLinkDB(indexfile + '.hlink')
 
@@ -279,7 +279,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
     if opt.smaller and ent.size >= opt.smaller:
         if exists and not hashvalid:
             if opt.verbose:
-                log('skipping large file "%s"' % ent.name)
+                log('Skipping large file "%s".' % ent.name)
             lastskip_name = ent.name
         continue
 
@@ -379,7 +379,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
                                             w.new_blob, w.new_tree, [f],
                                             keep_boundaries=False)
                 except (IOError, OSError), e:
-                    add_error('%s: %s' % (ent.name, e))
+                    add_error('%s: %s!' % (ent.name, e))
                     lastskip_name = ent.name
         else:
             if stat.S_ISDIR(ent.mode):
index ab6a5de84f6f59e74fce48f955518e2396c13c42..1e0e79c65ef09fa7f8efe3f5ca2eb4ab21fc961c 100755 (executable)
@@ -15,7 +15,7 @@ def do_help(conn, junk):
 def _set_mode():
     global dumb_server_mode
     dumb_server_mode = os.path.exists(git.repo('bup-dumb-server'))
-    debug1('bup server: serving in %s mode'
+    debug1('bup server: Serving in %s mode.'
            % (dumb_server_mode and 'dumb' or 'smart'))
 
 
@@ -26,13 +26,13 @@ def _init_session(reinit_with_new_repopath=None):
     # OK. we now know the path is a proper repository. Record this path in the
     # environment so that subprocesses inherit it and know where to operate.
     os.environ['BUP_DIR'] = git.repodir
-    debug1('bup server: bupdir is %r' % git.repodir)
+    debug1('bup server: bupdir is "%r".' % git.repodir)
     _set_mode()
 
 
 def init_dir(conn, arg):
     git.init_repo(arg)
-    debug1('bup server: bupdir initialized: %r' % git.repodir)
+    debug1('bup server: bupdir initialized: "%r".' % git.repodir)
     _init_session(arg)
     conn.ok()
 
@@ -83,7 +83,7 @@ def receive_objects_v2(conn, junk):
         n = struct.unpack('!I', ns)[0]
         #debug2('expecting %d bytes' % n)
         if not n:
-            debug1('bup server: received %d object%s.'
+            debug1('bup server: Received %d object%s.'
                 % (w.count, w.count!=1 and "s" or ''))
             fullpath = w.close(run_midx=not dumb_server_mode)
             if fullpath:
@@ -92,17 +92,17 @@ def receive_objects_v2(conn, junk):
             conn.ok()
             return
         elif n == 0xffffffff:
-            debug2('bup server: receive-objects suspended.')
+            debug2('bup server: Receive-objects suspended.')
             suspended_w = w
             conn.ok()
             return
-            
+
         shar = conn.read(20)
         crcr = struct.unpack('!I', conn.read(4))[0]
         n -= 20 + 4
         buf = conn.read(n)  # object sizes in bup are reasonably small
         #debug2('read %d bytes' % n)
-        _check(w, n, len(buf), 'object read: expected %d bytes, got %d\n')
+        _check(w, n, len(buf), 'Object read: Expected %d bytes, got %d\n')
         if not dumb_server_mode:
             oldpack = w.exists(shar, want_source=True)
             if oldpack:
@@ -110,7 +110,7 @@ def receive_objects_v2(conn, junk):
                 assert(oldpack.endswith('.idx'))
                 (dir,name) = os.path.split(oldpack)
                 if not (name in suggested):
-                    debug1("bup server: suggesting index %s"
+                    debug1("bup server: Suggesting index %s"
                            % git.shorten_hash(name))
                     debug1("bup server:   because of object %s"
                            % shar.encode('hex'))
@@ -118,7 +118,7 @@ def receive_objects_v2(conn, junk):
                     suggested.add(name)
                 continue
         nw, crc = w._raw_write((buf,), sha=shar)
-        _check(w, crcr, crc, 'object read: expected crc %d, got %d\n')
+        _check(w, crcr, crc, 'Object read: Expected CRC %d, got %d\n')
     # NOTREACHED
     
 
@@ -154,7 +154,7 @@ def cat(conn, id):
             conn.write(struct.pack('!I', len(blob)))
             conn.write(blob)
     except KeyError, e:
-        log('server: error: %s' % e)
+        log('bup server: Error: %s' % e)
         conn.write('\0\0\0\0')
         conn.error(e)
     else:
@@ -171,7 +171,7 @@ o = options.Options(optspec)
 if extra:
     o.fatal('no arguments expected')
 
-debug2('bup server: reading from stdin.')
+debug2('bup server: Reading from stdin.')
 
 commands = {
     'quit': None,
@@ -194,7 +194,7 @@ for _line in lr:
     line = _line.strip()
     if not line:
         continue
-    debug1('bup server: command: %r' % line)
+    debug1('bup server: Command: "%r" ...' % line)
     words = line.split(' ', 1)
     cmd = words[0]
     rest = len(words)>1 and words[1] or ''
@@ -207,4 +207,4 @@ for _line in lr:
         else:
             raise Exception('unknown server command: %r' % line)
 
-debug1('bup server: done')
+debug1('bup server: Done.')
index a6c15cd65d07290f4b07a34e6cc7df6d953fb590..a9ab8363087ebc3f31e6a9eff1d693bf1de794a8 100755 (executable)
@@ -124,7 +124,7 @@ if opt.git_ids:
                 it = cp.get(line.strip())
                 next(it, None)  # skip the file type
             except KeyError, e:
-                add_error('error: %s' % e)
+                add_error('Error: %s!' % e)
                 continue
             yield IterToFile(it)
     files = read_ids()
@@ -190,7 +190,7 @@ if cli:
 secs = time.time() - start_time
 size = hashsplit.total_split
 if opt.bench:
-    log('bup: %.2fkbytes in %.2f secs = %.2f kbytes/sec'
+    log('bup split: %.2fkbytes in %.2f secs = %.2f kbytes/sec.'
         % (size/1024., secs, size/1024./secs))
 
 if not check_saved_errors():
index 94d60259a61d062b7d81cb6fc1ab75be92ec9a3e..f89f1c2f648c59d91e7aa3c654f75aecc6320eef 100755 (executable)
@@ -32,7 +32,7 @@ if opt.delete:
     # contents of the tag file and pass the hash, and we already know
     # about the tag's existance via "tags".
     if not opt.force and opt.delete not in tags:
-        log("error: tag '%s' doesn't exist" % opt.delete)
+        log("Error: Tag '%s' doesn't exist!" % opt.delete)
         sys.exit(1)
     tag_file = 'refs/tags/%s' % opt.delete
     git.delete_ref(tag_file)
@@ -48,10 +48,10 @@ elif len(extra) < 2:
 (tag_name, commit) = extra[:2]
 if not tag_name:
     o.fatal("tag name must not be empty.")
-debug1("args: tag name = %s; commit = %s" % (tag_name, commit))
+debug1("Parameters: Tag name = %s; commit = %s" % (tag_name, commit))
 
 if tag_name in tags and not opt.force:
-    log("bup: error: tag '%s' already exists" % tag_name)
+    log("Error: Tag '%s' already exists!" % tag_name)
     sys.exit(1)
 
 if tag_name.startswith('.'):
@@ -60,23 +60,23 @@ if tag_name.startswith('.'):
 try:
     hash = git.rev_parse(commit)
 except git.GitError, e:
-    log("bup: error: %s" % e)
+    log("Error: %s!" % e)
     sys.exit(2)
 
 if not hash:
-    log("bup: error: commit %s not found." % commit)
+    log("Error: Commit %s not found!" % commit)
     sys.exit(2)
 
 pL = git.PackIdxList(git.repo('objects/pack'))
 if not pL.exists(hash):
-    log("bup: error: commit %s not found." % commit)
+    log("Error: Commit %s not found!" % commit)
     sys.exit(2)
 
 tag_file = git.repo('refs/tags/%s' % tag_name)
 try:
     tag = file(tag_file, 'w')
 except OSError, e:
-    log("bup: error: could not create tag '%s': %s" % (tag_name, e))
+    log("Error: Cannot create tag '%s': %s!" % (tag_name, e))
     sys.exit(3)
 
 tag.write(hash.encode('hex'))
index 96ed33223a26a7f61f67bd5e6c60fbf46745f03f..6450e1a8e3b30170a19e121380aa9b51fa0b301f 100755 (executable)
@@ -7,7 +7,7 @@ try:
     import tornado.ioloop
     import tornado.web
 except ImportError:
-    log('error: cannot find the python "tornado" module; please install it')
+    log('Error: Cannot find the python "tornado" module; please install it!')
     sys.exit(1)
 
 handle_ctrl_c()
@@ -79,7 +79,7 @@ class BupRequestHandler(tornado.web.RequestHandler):
     @tornado.web.asynchronous
     def _process_request(self, path):
         path = urllib.unquote(path)
-        print 'Handling request for %s' % path
+        print 'Handling request for "%s" ...' % path
         try:
             n = top.resolve(path)
         except vfs.NoSuchFile:
@@ -98,7 +98,7 @@ class BupRequestHandler(tornado.web.RequestHandler):
         error).  In either case, the headers are sent.
         """
         if not path.endswith('/') and len(path) > 0:
-            print 'Redirecting from %s to %s' % (path, path + '/')
+            print 'Redirecting from %s to %s.' % (path, path + '/')
             return self.redirect(path + '/', permanent=True)
 
         try:
@@ -225,7 +225,7 @@ if __name__ == "__main__":
     except AttributeError, e:
         sock = http_server._sockets.values()[0]
 
-    print "Serving HTTP on %s:%d..." % sock.getsockname()
+    print "Serving HTTP on %s:%d ..." % sock.getsockname()
 
     loop = tornado.ioloop.IOLoop.instance()
     if opt.browser:
index 62b845a245479eb9875ee902c1e08ce4731f735c..6d559c2a4b305125d9ee35fd1992b96ef1a42ded 100644 (file)
@@ -128,7 +128,7 @@ class ShaBloom:
             # flush it as one big lump during close().
             pages = os.fstat(f.fileno()).st_size / 4096 * 5 # assume k=5
             self.delaywrite = expected > pages
-            debug1('bloom: delaywrite=%r' % self.delaywrite)
+            debug1('Bloom filter: delaywrite=%r' % self.delaywrite)
             if self.delaywrite:
                 self.map = mmap_readwrite_private(self.rwfile, close=False)
             else:
@@ -139,15 +139,15 @@ class ShaBloom:
             self.map = mmap_read(f)
         got = str(self.map[0:4])
         if got != 'BLOM':
-            log('Warning: invalid BLOM header (%r) in %r' % (got, filename))
+            log('Warning: Invalid BLOM header (%r) in %r!' % (got, filename))
             return self._init_failed()
         ver = struct.unpack('!I', self.map[4:8])[0]
         if ver < BLOOM_VERSION:
-            log('Warning: ignoring old-style (v%d) bloom %r'
+            log('Warning: Ignoring old-style (v%d) bloom %r!'
                 % (ver, filename))
             return self._init_failed()
         if ver > BLOOM_VERSION:
-            log('Warning: ignoring too-new (v%d) bloom %r'
+            log('Warning: Ignoring too-new (v%d) bloom %r!'
                 % (ver, filename))
             return self._init_failed()
 
@@ -175,7 +175,7 @@ class ShaBloom:
 
     def close(self):
         if self.map and self.rwfile:
-            debug2("bloom: closing with %d entries" % self.entries)
+            debug2("Bloom filter: Closing with %d entries ..." % self.entries)
             self.map[12:16] = struct.pack('!I', self.entries)
             if self.delaywrite:
                 self.rwfile.seek(0)
@@ -224,9 +224,9 @@ def create(name, expected, delaywrite=None, f=None, k=None):
     bits = int(math.floor(math.log(expected*MAX_BITS_EACH/8,2)))
     k = k or ((bits <= MAX_BLOOM_BITS[5]) and 5 or 4)
     if bits > MAX_BLOOM_BITS[k]:
-        log('bloom: warning, max bits exceeded, non-optimal')
+        log('Bloom filter: Warning, max bits exceeded, non-optimal!')
         bits = MAX_BLOOM_BITS[k]
-    debug1('bloom: using 2^%d bytes and %d hash functions' % (bits, k))
+    debug1('Bloom filter: Using 2^%d bytes and %d hash functions.' % (bits, k))
     f = f or open(name, 'w+b')
     f.write('BLOM')
     f.write(struct.pack('!IHHI', BLOOM_VERSION, bits, k, 0))
index 79b3d303985fca13df3fdb1f985e9ee46d7cad9f..4174912d5ef1e2f87427ea86a6b00f80a9ed7ba6 100644 (file)
@@ -170,10 +170,10 @@ class Client:
             extra.discard(idx)
 
         self.check_ok()
-        debug1('client: removing extra indexes: %s' % extra)
+        debug1('Client: Removing extra indexes: %s' % extra)
         for idx in extra:
             os.unlink(os.path.join(self.cachedir, idx))
-        debug1('client: server requested load of: %s' % needed)
+        debug1('Client: Server requested load of: %s' % needed)
         for idx in needed:
             self.sync_index(idx)
         git.auto_midx(self.cachedir)
@@ -184,7 +184,7 @@ class Client:
         mkdirp(self.cachedir)
         fn = os.path.join(self.cachedir, name)
         if os.path.exists(fn):
-            msg = "won't request existing .idx, try `bup bloom --check %s`" % fn
+            msg = "Won't request existing .idx, try `bup bloom --check %s`" % fn
             raise ClientError(msg)
         self.conn.write('send-index %s\n' % name)
         n = struct.unpack('!I', self.conn.read(4))[0]
@@ -214,12 +214,12 @@ class Client:
             debug2('%s' % line)
             if line.startswith('index '):
                 idx = line[6:]
-                debug1('client: received index suggestion: %s'
+                debug1('Client: Received index suggestion: %s'
                        % git.shorten_hash(idx))
                 suggested.append(idx)
             else:
                 assert(line.endswith('.idx'))
-                debug1('client: completed writing pack, idx: %s'
+                debug1('Client: Completed writing pack, idx: %s'
                        % git.shorten_hash(line))
                 suggested.append(line)
         self.check_ok()
index 2d765291a596fc53af132ed93d3e79cb8cf5df4a..9a8e947e33845411da6feb3812811b3a8c1bee35 100644 (file)
@@ -40,7 +40,7 @@ def _dirlist():
         try:
             st = xstat.lstat(n)
         except OSError, e:
-            add_error(Exception('%s: %s' % (realpath(n), str(e))))
+            add_error('%s: %s!' % (realpath(n), e))
             continue
         if (st.st_mode & _IFMT) == stat.S_IFDIR:
             n += '/'
@@ -66,12 +66,12 @@ def _recursive_dirlist(prepend, xdev, bup_dir=None,
                     debug1('Skipping BUP_DIR.')
                     continue
             if xdev != None and pst.st_dev != xdev:
-                debug1('Skipping contents of %r: different filesystem.' % path)
+                debug1('Skipping contents of %r: Different filesystem.' % path)
             else:
                 try:
                     OsFile(name).fchdir()
                 except OSError, e:
-                    add_error('%s: %s' % (prepend, e))
+                    add_error('%s: %s!' % (prepend, e))
                 else:
                     for i in _recursive_dirlist(prepend=prepend+name, xdev=xdev,
                                                 bup_dir=bup_dir,
@@ -94,7 +94,7 @@ def recursive_dirlist(paths, xdev, bup_dir=None, excluded_paths=None,
                     yield (path, pst)
                     continue
             except OSError, e:
-                add_error('recursive_dirlist: %s' % e)
+                add_error('recursive_dirlist(): %s!' % e)
                 continue
             try:
                 pfile = OsFile(path)
index 32335024d516d4acccb950bf13d2b7f441668046..c35803dc6551fcf990472ad8f2fc06f65dcfce7e 100644 (file)
@@ -130,20 +130,20 @@ def auto_midx(objdir):
         rv = subprocess.call(args, stdout=open('/dev/null', 'w'))
     except OSError, e:
         # make sure 'args' gets printed to help with debugging
-        add_error('%r: exception: %s' % (args, e))
+        add_error('%r: Exception: %s!' % (args, e))
         raise
     if rv:
-        add_error('%r: returned %d' % (args, rv))
+        add_error('%r: Returned %d!' % (args, rv))
 
     args = [path.exe(), 'bloom', '--dir', objdir]
     try:
         rv = subprocess.call(args, stdout=open('/dev/null', 'w'))
     except OSError, e:
         # make sure 'args' gets printed to help with debugging
-        add_error('%r: exception: %s' % (args, e))
+        add_error('%r: Exception: %s!' % (args, e))
         raise
     if rv:
-        add_error('%r: returned %d' % (args, rv))
+        add_error('%r: Returned %d!' % (args, rv))
 
 
 def mangle_name(name, mode, gitmode):
@@ -466,7 +466,7 @@ class PackIdxList:
                         broken = False
                         for n in mx.idxnames:
                             if not os.path.exists(os.path.join(mxd, n)):
-                                log('warning: index %s missing!' % n)
+                                log('Warning: Index %s missing!' % n)
                                 log('  used by %s\n' % mxf)
                                 broken = True
                         if broken:
@@ -490,7 +490,7 @@ class PackIdxList:
                         for name in ix.idxnames:
                             d[os.path.join(self.dir, name)] = ix
                     elif not ix.force_keep:
-                        debug1('midx: removing redundant: %s'
+                        debug1('Multi-index: Removing redundant: %s'
                                % os.path.basename(ix.name))
                         ix.close()
                         unlink(ix.name)
@@ -511,7 +511,7 @@ class PackIdxList:
                 self.do_bloom = True
             else:
                 self.bloom = None
-        debug1('PackIdxList: using %d index%s.'
+        debug1('PackIdxList: Using %d index%s.'
             % (len(self.packs), len(self.packs)!=1 and 'es' or ''))
 
     def add(self, hash):
@@ -854,7 +854,7 @@ def rev_parse(committish, repo_dir=None):
     """
     head = read_ref(committish, repo_dir=repo_dir)
     if head:
-        debug2("resolved from ref: commit = %s" % head.encode('hex'))
+        debug2("Resolved from ref: commit = %s" % head.encode('hex'))
         return head
 
     pL = PackIdxList(repo('objects/pack', repo_dir=repo_dir))
@@ -940,11 +940,11 @@ def check_repo_or_die(path=None):
         os.stat(repo('objects/pack/.'))
     except OSError, e:
         if e.errno == errno.ENOENT:
-            log('error: %r is not a bup repository; run "bup init"'
+            log('Error: %r is not a bup repository; run "bup init"!'
                 % repo())
             sys.exit(15)
         else:
-            log('error: %s' % e)
+            log('Error: %s!' % e)
             sys.exit(14)
 
 
@@ -1027,7 +1027,7 @@ class CatPipe:
         wanted = ('1','5','6')
         if ver() < wanted:
             if not _ver_warned:
-                log('warning: git version < %s; bup will be slow.'
+                log('Warning: Git version < %s; bup will be slow.'
                     % '.'.join(wanted))
                 _ver_warned = 1
             self.get = self._slow_get
index 2eccf6208fac8d4ea77d7a8aeb92ac3b6482b41c..a5ad83101953d0b086d43b0bb3db7663ebccb685 100644 (file)
@@ -555,7 +555,7 @@ class DemuxConn(BaseConn):
                 sys.stderr.write(buf)
         elif fdw == 3:
             self.closed = True
-            debug2("DemuxConn: marked closed")
+            debug2("DemuxConn: Marked closed.")
         return True
 
     def _load_buf(self, timeout):
@@ -887,7 +887,7 @@ def parse_rx_excludes(options, fatal):
             try:
                 excluded_patterns.append(re.compile(parameter))
             except re.error, ex:
-                fatal('invalid --exclude-rx pattern (%s): %s' % (parameter, ex))
+                fatal('Invalid --exclude-rx pattern (%s): %s!' % (parameter, ex))
         elif option == '--exclude-rx-from':
             try:
                 f = open(realpath(parameter))
@@ -900,7 +900,7 @@ def parse_rx_excludes(options, fatal):
                 try:
                     excluded_patterns.append(re.compile(spattern))
                 except re.error, ex:
-                    fatal('invalid --exclude-rx pattern (%s): %s' % (spattern, ex))
+                    fatal('Invalid --exclude-rx pattern (%s): %s!' % (spattern, ex))
     return excluded_patterns
 
 
index 766d5b7298da66d91bf8f14d60cfac31aa441546..a7967bdf5df1c0f156dc050f3f8e1980e016fe9e 100644 (file)
@@ -70,7 +70,7 @@ class MetaStoreWriter:
             except EOFError:
                 pass
             except:
-                log('index metadata in %r appears to be corrupt' % filename)
+                log('Index metadata in %r appears to be corrupt!' % filename)
                 raise
         finally:
             m_file.close()
@@ -369,7 +369,7 @@ class Reader:
         if f:
             b = f.read(len(INDEX_HDR))
             if b != INDEX_HDR:
-                log('warning: %s: header: expected %r, got %r'
+                log('Warning: %s: Expected %r, got %r in header!'
                                  % (filename, INDEX_HDR, b))
             else:
                 st = os.fstat(f.fileno())
@@ -546,7 +546,7 @@ def reduce_paths(paths):
                 p = slashappend(p)
             xpaths.append((rp, p))
         except OSError, e:
-            add_error('reduce_paths: %s' % e)
+            add_error('reduce_paths(): %s!' % e)
     xpaths.sort()
 
     paths = []
@@ -562,7 +562,7 @@ def reduce_paths(paths):
 
 def merge(*iters):
     def pfunc(count, total):
-        progress_update('bup: merging indexes (%d/%d) ...' % (count, total), False)
+        progress_update('Merging indexes (%d/%d) ...' % (count, total), False)
     def pfinal(count, total):
-        progress_end('bup: merging indexes (%d/%d), done.' % (count, total))
+        progress_end('Merging indexes (%d/%d), done.' % (count, total))
     return merge_iter(iters, 1024, pfunc, pfinal, key='name')
index 4862c9fb405f233bb1dc32b88437ba765ff1bd83..57ed030a5b696c8d567cdedecac4d67108643898 100644 (file)
@@ -121,7 +121,7 @@ def do_ls(args, pwd, default='.', onabort=None, spec_prefix=''):
             else:
                 output_node_info(n, os.path.normpath(path))
         except vfs.NodeError, e:
-            log('error: %s' % e)
+            log('Error: %s!' % e)
             ret = 1
 
     if L:
index b8cb94ba59b592ab0ab7c6820dc58429cb18b33f..44ced3a7b7aa96d992a71c4623d7e475aaf48ac8 100644 (file)
@@ -17,13 +17,13 @@ if sys.platform.startswith('linux'):
     try:
         import xattr
     except ImportError:
-        log('Warning: Linux xattr support missing; install python-pyxattr.')
+        log('Warning: Linux xattr support missing; install "python-pyxattr"!')
     if xattr:
         try:
             xattr.get_all
         except AttributeError:
-            log('Warning: python-xattr module is too old; '
-                'install python-pyxattr instead.\n')
+            log('Warning: "python-xattr" module is too old; '
+                'install "python-pyxattr" instead!')
             xattr = None
 
 posix1e = None
@@ -33,7 +33,7 @@ if not (sys.platform.startswith('cygwin') \
     try:
         import posix1e
     except ImportError:
-        log('Warning: POSIX ACL support missing; install python-pylibacl.')
+        log('Warning: POSIX ACL support missing; install "python-pylibacl"!')
 
 try:
     from bup._helpers import get_linux_file_attr, set_linux_file_attr
@@ -312,7 +312,7 @@ class Metadata:
                     os.rmdir(path)
                 except OSError, e:
                     if e.errno in (errno.ENOTEMPTY, errno.EEXIST):
-                        msg = 'refusing to overwrite non-empty dir ' + path
+                        msg = 'Refusing to overwrite non-empty dir ' + path
                         raise Exception(msg)
                     raise
             else:
@@ -357,7 +357,7 @@ class Metadata:
         # FIXME: S_ISDOOR, S_IFMPB, S_IFCMP, S_IFNWK, ... see stat(2).
         else:
             assert(not self._recognized_file_type())
-            add_error('not creating "%s" with unrecognized mode "0x%x"'
+            add_error('Not creating "%s" with unrecognized mode "0x%x"!'
                       % (path, self.mode))
 
     def _apply_common_rec(self, path, restore_numeric_ids=False):
@@ -413,10 +413,10 @@ class Metadata:
                 os.lchown(path, uid, gid)
             except OSError, e:
                 if e.errno == errno.EPERM:
-                    add_error('lchown: %s' %  e)
+                    add_error('lchown(): %s!' %  e)
                 elif sys.platform.startswith('cygwin') \
                    and e.errno == errno.EINVAL:
-                    add_error('lchown: unknown uid/gid (%d/%d) for %s'
+                    add_error('lchown(): Unknown uid/gid (%d/%d) for %s!'
                               %  (uid, gid, path))
                 else:
                     raise
@@ -446,7 +446,7 @@ class Metadata:
             if stat.S_ISLNK(st.st_mode):
                 self.symlink_target = os.readlink(path)
         except OSError, e:
-            add_error('readlink: %s' % e)
+            add_error('readlink(): %s!' % e)
 
     def _encode_symlink_target(self):
         return self.symlink_target
@@ -547,7 +547,7 @@ class Metadata:
 
         if not posix1e:
             if self.posix1e_acl:
-                add_error("%s: can't restore ACLs; posix1e support missing."
+                add_error("%s: Cannot restore ACLs; POSIX1e support missing!"
                           % path)
             return
         if self.posix1e_acl:
@@ -575,7 +575,7 @@ class Metadata:
                     self.linux_attr = attr
             except OSError, e:
                 if e.errno == errno.EACCES:
-                    add_error('read Linux attr: %s' % e)
+                    add_error('Read Linux attr: %s!' % e)
                 elif e.errno in (errno.ENOTTY, errno.ENOSYS, errno.EOPNOTSUPP):
                     # Assume filesystem doesn't support attrs.
                     return
@@ -600,8 +600,8 @@ class Metadata:
         if self.linux_attr:
             check_linux_file_attr_api()
             if not set_linux_file_attr:
-                add_error("%s: can't restore linuxattrs: "
-                          "linuxattr support missing.\n" % path)
+                add_error("%s: Cannot restore Linux attrs: "
+                          "linuxattr support missing!" % path)
                 return
             try:
                 set_linux_file_attr(path, self.linux_attr)
@@ -650,7 +650,7 @@ class Metadata:
     def _apply_linux_xattr_rec(self, path, restore_numeric_ids=False):
         if not xattr:
             if self.linux_xattr:
-                add_error("%s: can't restore xattr; xattr support missing."
+                add_error("%s: Cannot restore xattr; xattr support missing!"
                           % path)
             return
         if not self.linux_xattr:
@@ -793,8 +793,8 @@ class Metadata:
         if not path:
             raise Exception('Metadata.apply_to_path() called with no path')
         if not self._recognized_file_type():
-            add_error('not applying metadata to "%s"' % path
-                      + ' with unrecognized mode "0x%x"\n' % self.mode)
+            add_error('Not applying metadata to "%s"' % path
+                      + ' with unrecognized mode "0x%x"!' % self.mode)
             return
         num_ids = restore_numeric_ids
         for apply_metadata in (self._apply_common_rec,
@@ -844,7 +844,7 @@ def save_tree(output_file, paths,
     for path in paths:
         safe_path = _clean_up_path_for_archive(path)
         if safe_path != path:
-            log('archiving "%s" as "%s"' % (path, safe_path))
+            log('Archiving "%s" as "%s".' % (path, safe_path))
 
     if not recurse:
         for p in paths:
@@ -1047,7 +1047,7 @@ def display_archive(file):
         for meta in _ArchiveIterator(file):
             if not meta.path:
                 print >> sys.stderr, \
-                    'bup: no metadata path, but asked to only display path', \
+                    'No metadata path, but asked to only display path', \
                     '(increase verbosity?)'
                 sys.exit(1)
             print meta.path
@@ -1061,7 +1061,7 @@ def start_extract(file, create_symlinks=True):
             print >> sys.stderr, meta.path
         xpath = _clean_up_extract_path(meta.path)
         if not xpath:
-            add_error(Exception('skipping risky path "%s"' % meta.path))
+            add_error(Exception('Skipping risky path "%s"!' % meta.path))
         else:
             meta.path = xpath
             _set_up_path(meta, create_symlinks=create_symlinks)
@@ -1074,7 +1074,7 @@ def finish_extract(file, restore_numeric_ids=False):
             break
         xpath = _clean_up_extract_path(meta.path)
         if not xpath:
-            add_error(Exception('skipping risky path "%s"' % dir.path))
+            add_error(Exception('Skipping risky path "%s"!' % dir.path))
         else:
             if os.path.isdir(meta.path):
                 all_dirs.append(meta)
@@ -1101,7 +1101,7 @@ def extract(file, restore_numeric_ids=False, create_symlinks=True):
             break
         xpath = _clean_up_extract_path(meta.path)
         if not xpath:
-            add_error(Exception('skipping risky path "%s"' % meta.path))
+            add_error(Exception('Skipping risky path "%s"!' % meta.path))
         else:
             meta.path = xpath
             if verbose:
index 85ad90120dc88954ab358b75f3133204a6ef446b..eeb3241ab4e94518b65cdafb217eeca0deb9fd8a 100644 (file)
@@ -22,17 +22,17 @@ class PackMidx:
         assert(filename.endswith('.midx'))
         self.map = mmap_read(open(filename))
         if str(self.map[0:4]) != 'MIDX':
-            log('Warning: skipping: invalid MIDX header in %r' % filename)
+            log('Warning: Skipping invalid midx header in %r!' % filename)
             self.force_keep = True
             return self._init_failed()
         ver = struct.unpack('!I', self.map[4:8])[0]
         if ver < MIDX_VERSION:
-            log('Warning: ignoring old-style (v%d) midx %r'
+            log('Warning: Ignoring old-style (v%d) midx %r!'
                 % (ver, filename))
             self.force_keep = False  # old stuff is boring  
             return self._init_failed()
         if ver > MIDX_VERSION:
-            log('Warning: ignoring too-new (v%d) midx %r'
+            log('Warning: Ignoring too-new (v%d) midx %r!'
                 % (ver, filename))
             self.force_keep = True  # new stuff is exciting
             return self._init_failed()
index 65702e2a80c8629d530ea5e1d41938e0195a9f23..10cd282d6deab7846939da1b95c1ee59d05bb5a5 100644 (file)
@@ -166,7 +166,7 @@ class Options:
         while lines:
             l = lines.pop()
             if l == '--': break
-            out.append('%s: %s\n' % (first_syn and 'usage' or '   or', l))
+            out.append('%s: %s\n' % (first_syn and 'Usage' or '   or', l))
             first_syn = False
         out.append('\n')
         last_was_option = False
diff --git a/main.py b/main.py
index 0a63de2806dc4478adfa684989a44aa6a776f73a..d7dc1eba5dabfd522727a7ae42a50f9cb339da4a 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -76,7 +76,7 @@ try:
     optspec = ['help', 'version', 'debug', 'profile', 'bup-dir=']
     global_args, subcmd = getopt.getopt(argv[1:], '?VDd:', optspec)
 except getopt.GetoptError, ex:
-    usage('error: %s' % ex.msg)
+    usage('Error: %s!' % ex.msg)
 
 help_requested = None
 do_profile = False
@@ -94,7 +94,7 @@ for opt in global_args:
     elif opt[0] in ['-d', '--bup-dir']:
         os.environ['BUP_DIR'] = opt[1]
     else:
-        usage('error: unexpected option "%s"' % opt[0])
+        usage('Error: Unexpected option "%s"!' % opt[0])
 
 # Make BUP_DIR absolute, so we aren't affected by chdir (i.e. save -C, etc.).
 if 'BUP_DIR' in os.environ:
@@ -124,7 +124,7 @@ def subpath(s):
 
 subcmd[0] = subpath(subcmd_name)
 if not os.path.exists(subcmd[0]):
-    usage('error: unknown command "%s"' % subcmd_name)
+    usage('Error: Unknown command "%s"!' % subcmd_name)
 
 already_fixed = atoi(os.environ.get('BUP_FORCE_TTY'))
 if subcmd_name in ['mux', 'ftp', 'help']:
@@ -157,7 +157,7 @@ p = None
 forward_signals = True
 
 def handler(signum, frame):
-    debug1('bup: Signal %d received.' % signum)
+    debug1('bup: Signal %d received!' % signum)
     if not p or not forward_signals:
         return
     if signum != signal.SIGTSTP: