diff options
-rwxr-xr-x | whatmaps/command.py | 4 | ||||
-rw-r--r-- | whatmaps/debiandistro.py | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/whatmaps/command.py b/whatmaps/command.py index 0f8e433..263f964 100755 --- a/whatmaps/command.py +++ b/whatmaps/command.py @@ -174,7 +174,9 @@ def main(argv): return 1 if not pkgs: return 0 - pkgs = distro.filter_security_updates(pkgs) + pkgs, notfound = distro.filter_security_updates(pkgs) + if notfound: + logging.warning("Pkgs %s not found in apt cache" % ", ".join(notfound)) logging.debug("Security Upgrades: %s" % pkgs) else: parser.print_help() 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) |