From: Brandon Low Date: Mon, 7 Feb 2011 16:19:04 +0000 (-0800) Subject: Fix updating of bloom with additional files X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=29d3e263ee12085a4eeb4ff43d99e4860ac295d2;p=packages%2Fb%2Fbup.git Fix updating of bloom with additional files Make bloom add additional .idx files when it's run on a repo with an existing bloom filter file rather than just regenerating all the time. Signed-off-by: Brandon Low --- diff --git a/cmd/bloom-cmd.py b/cmd/bloom-cmd.py index eb962a7..92cdf8b 100755 --- a/cmd/bloom-cmd.py +++ b/cmd/bloom-cmd.py @@ -20,6 +20,7 @@ def do_bloom(path, outfilename): if os.path.exists(outfilename): b = git.ShaBloom(outfilename, readwrite=True) if not b.valid(): + debug1("bloom: Existing invalid bloom found, regenerating.\n") b = None add = [] @@ -60,7 +61,7 @@ def do_bloom(path, outfilename): msg = b is None and 'creating from' or 'adding' log('bloom: %s %d files (%d objects).\n' % (msg, len(add), add_count)) - tempname = None + tfname = None if b is None: tfname = os.path.join(path, 'bup.tmp.bloom') tf = open(tfname, 'w+') @@ -73,8 +74,8 @@ def do_bloom(path, outfilename): count += 1 log('Writing bloom: %d/%d, done.\n' % (count, len(add))) - if tempname: - os.rename(tempname, outfilename) + if tfname: + os.rename(tfname, outfilename) handle_ctrl_c()