[Git][security-tracker-team/security-tracker][fix_987283] Simplify the code

Anton Gladky (@gladk) gladk at debian.org
Wed May 24 15:59:04 BST 2023



Anton Gladky pushed to branch fix_987283 at Debian Security Tracker / security-tracker


Commits:
bac5fccf by Anton Gladky at 2023-05-24T16:58:34+02:00
Simplify the code

- - - - -


1 changed file:

- lib/python/security_db.py


Changes:

=====================================
lib/python/security_db.py
=====================================
@@ -966,20 +966,19 @@ class DB:
             return True
 
         source_removed_packages = '/packages/removed-packages'
+        source_ignored_unreported = 'data/packages/ignored-debian-bug-packages'
         sources = self.getSources()
         source_paths = [src["path"] for src in sources]
 
         unchanged = True
-        for filename in source_paths + [source_removed_packages]:
+
+
+        for filename in source_paths + [source_removed_packages, source_ignored_unreported]:
+            print (path + filename)
             if has_changed(path + filename):
                 unchanged = False
                 break
 
-        # Check if the ignored packages file has changed
-        source_ignore_unreported = "data/packages/ignored-debian-bug-packages"
-        if has_changed(path + filename):
-            unchanged = False
-
         if unchanged:
             if self.verbose:
                 print("  finished (no changes)")
@@ -1008,16 +1007,16 @@ class DB:
 
 
         # Add file print to database for ignored packages
-        current_print = self.filePrint(source_ignore_unreported)
+        current_print = self.filePrint(source_ignored_unreported)
         cursor.execute(
             """INSERT OR REPLACE INTO inodeprints (inodeprint, file)
-            VALUES (?, ?)""", (current_print, source_ignore_unreported))
+            VALUES (?, ?)""", (current_print, source_ignored_unreported))
 
         if self.verbose:
             print("  update ignored packages")
 
         # Read list of packages, which should be ignored for the status/unreported
-        self.readRemovedAndIgnoredPackages(cursor, source_ignore_unreported, table = "ignored_packages")
+        self.readRemovedAndIgnoredPackages(cursor, source_ignored_unreported, table = "ignored_packages")
 
 
         errors = []



View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/bac5fccf07af52fc6a3085cd6be7f829283d6ed8

-- 
View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/bac5fccf07af52fc6a3085cd6be7f829283d6ed8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-security-tracker-commits/attachments/20230524/72241e4f/attachment-0001.htm>


More information about the debian-security-tracker-commits mailing list