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 | 5942b0aeb97636203d6f7754908ff92fe3ba6830 (patch) | |
tree | 1ab4763ac95fd5d763dd9c5d835744314b3ad274 /lib | |
parent | b87db43d7bc3041cb2fd6a766fa4244605c0263a (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" |