log('check: passed.\n')
-def update_index(top):
+def update_index(top, excluded_paths):
ri = index.Reader(indexfile)
wi = index.Writer(indexfile)
rig = IterHelper(ri.iter(name=top))
total = 0
bup_dir = os.path.abspath(git.repo())
for (path,pst) in drecurse.recursive_dirlist([top], xdev=opt.xdev,
- bup_dir=bup_dir):
+ bup_dir=bup_dir,
+ excluded_paths=excluded_paths):
if opt.verbose>=2 or (opt.verbose==1 and stat.S_ISDIR(pst.st_mode)):
sys.stdout.write('%s\n' % path)
sys.stdout.flush()
fake-valid mark all index entries as up-to-date even if they aren't
fake-invalid mark all index entries as invalid
check carefully check index file integrity
-f,indexfile= the name of the index file (default 'index')
+f,indexfile= the name of the index file (normally BUP_DIR/bupindex)
+exclude= a path to exclude from the backup (can be used more than once)
+exclude-from= a file that contains exclude paths (can be used more than once)
v,verbose increase log output (can be used more than once)
"""
-o = options.Options('bup index', optspec)
+o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
if not (opt.modified or opt['print'] or opt.status or opt.update or opt.check):
log('check: starting initial check.\n')
check_index(index.Reader(indexfile))
+excluded_paths = drecurse.parse_excludes(flags)
+
paths = index.reduce_paths(extra)
if opt.update:
if not extra:
o.fatal('update (-u) requested but no paths given')
for (rp,path) in paths:
- update_index(rp)
+ update_index(rp, excluded_paths)
if opt['print'] or opt.status or opt.modified:
for (name, ent) in index.Reader(indexfile).filter(extra or ['']):