diff options
author | Anton Gladky <gladk@debian.org> | 2023-05-25 13:51:43 +0200 |
---|---|---|
committer | Anton Gladky <gladk@debian.org> | 2023-05-25 13:51:43 +0200 |
commit | b232fb0bb12c1384ab797331df51dc8d8d890ef2 (patch) | |
tree | 52a336a8cddd581eb76ed6f1fd643b1dc0ae5145 /lib/python | |
parent | e6c6899ac48a0f9c7fe47ea6d50d5594c7fcfcf8 (diff) |
Add file print of the removed_packages into DB
Diffstat (limited to 'lib/python')
-rw-r--r-- | lib/python/security_db.py | 13 |
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).""" |