- hashfile = os.path.join(os.path.dirname(filename), 'by-hash', field, fileinfo[filename][field])
- query = "SELECT 1 FROM hashfile WHERE path = :p AND suite_id = :id"
- q = session.execute(
- query,
- {'p': hashfile, 'id': suite.suite_id})
- if q.rowcount:
- session.execute('''
- UPDATE hashfile SET unreferenced = NULL
- WHERE path = :p and suite_id = :id''',
- {'p': hashfile, 'id': suite.suite_id})
+ hashfile = os.path.join(byhashdir, field, fileinfo[filename][field])
+ if hashfile in known_hashfiles:
+ updated.append(hashfile)