diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-04-18 08:30:05 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-04-18 08:30:05 +0200 |
commit | 0bcd51ef848059359c4a9a37d2ecf3b8efc8bf81 (patch) | |
tree | f7097127c68a3aabd69445de854eb077fa70202a /whatmaps/debiandistro.py | |
parent | 73afbae396ca636140d7732eef46994aebbf25bf (diff) |
Don't bail out if we can't find a package in apt's cache
Rather warn about it and continue so we get restarts for all other
packages.
Diffstat (limited to 'whatmaps/debiandistro.py')
-rw-r--r-- | whatmaps/debiandistro.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py index 32f3774..1a1dbd4 100644 --- a/whatmaps/debiandistro.py +++ b/whatmaps/debiandistro.py @@ -165,9 +165,14 @@ class DebianDistro(Distro): security_update_origins = klass._security_update_origins() security_updates = {} + notfound = [] for pkg in list(pkgs.values()): - cache_pkg = cache[pkg.name] + try: + cache_pkg = cache[pkg.name] + except KeyError: + notfound.append(pkg) + continue for cache_version in cache_pkg.version_list: if pkg.version == cache_version.ver_str: for pfile, _ in cache_version.file_list: @@ -176,4 +181,4 @@ class DebianDistro(Distro): pfile.archive == origin[1]: security_updates[pkg] = pkg break - return security_updates + return (security_updates, notfound) |