summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnton Gladky <gladk@debian.org>2023-05-25 13:51:43 +0200
committerAnton Gladky <gladk@debian.org>2023-05-25 13:51:43 +0200
commitb232fb0bb12c1384ab797331df51dc8d8d890ef2 (patch)
tree52a336a8cddd581eb76ed6f1fd643b1dc0ae5145 /lib
parente6c6899ac48a0f9c7fe47ea6d50d5594c7fcfcf8 (diff)
Add file print of the removed_packages into DB
Diffstat (limited to 'lib')
-rw-r--r--lib/python/security_db.py13
1 files changed, 13 insertions, 0 deletions
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)."""

© 2014-2024 Faster IT GmbH | imprint | privacy policy