diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-06-15 10:59:20 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-06-15 10:59:20 +0200 |
commit | ebe678460d2044fe6c4ea52c707e2a76e0187b76 (patch) | |
tree | 38cba22bc0894eed41b67e662684f179a770c952 /lib | |
parent | 6ebaabcfa933fd1e69b533719c260b25baa5747b (diff) |
sources: add name and path info
This avoids having to guess the name from the path.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/security_db.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 9bcbb3eaec..dcca00f9fd 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -866,9 +866,9 @@ class DB: sources = self.getSources() advs = [] - for path, cls in sources.iteritems(): - name = path.split('/')[1] - + for src in sources: + name = src["name"] + cls = src["class"] if cls == 'DSAFile': advs.append(name) @@ -936,9 +936,10 @@ class DB: source_removed_packages = '/packages/removed-packages' sources = self.getSources() + source_paths = [src["path"] for src in sources] unchanged = True - for filename in sources.keys() + [source_removed_packages]: + for filename in source_paths + [source_removed_packages]: if has_changed(path + filename): unchanged = False break @@ -958,9 +959,11 @@ class DB: """INSERT OR REPLACE INTO inodeprints (inodeprint, file) VALUES (?, ?)""", (current_print, filename)) - for name, cls in sources.iteritems(): + for src in sources: + srcpath = src["path"] + cls = src["class"] cls = getattr(bugs, cls) - read_one(cls(path + name)) + read_one(cls(path + srcpath)) if self.verbose: print " update removed packages" |