From ccf4bbf54754221e54a1c14e92d72c16593fe98b Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Wed, 30 Aug 2023 14:54:27 +0200 Subject: [PATCH] Use logical paths rather than physical --- bin/datastore.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/datastore.py b/bin/datastore.py index 0c16928..e6441d0 100644 --- a/bin/datastore.py +++ b/bin/datastore.py @@ -95,7 +95,7 @@ class Datastore: cursor.execute(qry, (filepath,)) results = cursor.fetchall() if len(results): - return (filepath, file_hash(filepath)) in results + return (filepath, file_hash(configuration.translate_path(filepath))) in results def add_file(self, path, cursor = None): @@ -107,7 +107,8 @@ class Datastore: else: cur = cursor - hash = file_hash(path) + realpath = configuration.translate_path(path) + hash = file_hash(realpath) qry = "CALL add_file(%s, %s);" cur.execute(qry, (path, hash)) if cursor is None: @@ -176,7 +177,7 @@ class Datastore: else: cur = cursor - hash = file_hash(path) + hash = file_hash(configuration.translate_path(path)) qry = """ UPDATE raw_lines rl SET ntbp = %s