From b232fb0bb12c1384ab797331df51dc8d8d890ef2 Mon Sep 17 00:00:00 2001 From: Anton Gladky Date: Thu, 25 May 2023 13:51:43 +0200 Subject: Add file print of the removed_packages into DB --- lib/python/security_db.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/python/security_db.py b/lib/python/security_db.py index c4f163cb7a..f293e1b3e8 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -963,14 +963,19 @@ class DB: source_paths = [src["path"] for src in sources] unchanged = True + changed_source = None for filename in source_paths + [source_removed_packages]: if has_changed(path + filename): unchanged = False + changed_source = path + filename break if unchanged: if self.verbose: print(" finished (no changes)") return + else: + if self.verbose: + print(f" clearing database, because some files have changed ({changed_source})") clear_db() @@ -1992,6 +1997,14 @@ class DB: cursor.executemany( "INSERT OR IGNORE INTO removed_packages (name) VALUES (?)", gen()) + + # Add file print to database for removed packages + current_print = self.filePrint(filename) + cursor.execute( + """INSERT OR REPLACE INTO inodeprints (inodeprint, file) + VALUES (?, ?)""", (current_print, filename)) + + def getUnknownPackages(self, cursor): """Returns a generator for a list of unknown packages. Each entry has the form (PACKAGE, BUG-LIST).""" -- cgit v1.2.3