From 0bcd51ef848059359c4a9a37d2ecf3b8efc8bf81 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 18 Apr 2016 08:30:05 +0200 Subject: 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. --- whatmaps/debiandistro.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'whatmaps/debiandistro.py') 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) -- cgit v1.2.3