verify covers against db instead of fs

This commit is contained in:
ed 2023-03-15 19:48:43 +00:00
parent 5af1575329
commit e0c4829ec6

View file

@ -1251,12 +1251,15 @@ class Up2k(object):
if n_rm2:
self.log("forgetting {} shadowed deleted files".format(n_rm2))
c2.connection.commit()
# then covers
n_rm3 = 0
qu = "select 1 from up where rd=? and +fn=? limit 1"
q = "delete from cv where rd=? and dn=? and +fn=?"
for crd, cdn, fn in cur.execute("select * from cv"):
ap = os.path.join(top, crd, cdn, fn)
if not bos.path.exists(ap):
urd = vjoin(crd, cdn)
if not c2.execute(qu, (urd, fn)).fetchone():
c2.execute(q, (crd, cdn, fn))
n_rm3 += 1