From 9cb7517443b8dc25596a3d3b1fb75f05380c1f19 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 23 Sep 2016 12:12:22 +0200 Subject: Don't abort if we can't parse a single package so far we would abort the whole operation, skip the unreadable packages instead and return with non-zero. --- whatmaps/command.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/whatmaps/command.py b/whatmaps/command.py index 913268c..8d0be31 100755 --- a/whatmaps/command.py +++ b/whatmaps/command.py @@ -132,6 +132,7 @@ def find_systemd_units(procmap, distro): def main(argv): shared_objects = [] services = None + ret = 0 parser = OptionParser(usage='%prog [options] pkg1 [pkg2 pkg3 pkg4]') parser.add_option("--debug", action="store_true", dest="debug", @@ -187,8 +188,8 @@ def main(argv): try: shared_objects += pkg.shared_objects except PkgError: - logging.error("Cannot parse contents of %s" % pkg.name) - return 1 + logging.error("Cannot parse contents of %s - skipping it" % pkg.name) + ret = 1 logging.debug("Found shared objects:") for so in shared_objects: logging.debug(" %s", so) @@ -240,7 +241,7 @@ def main(argv): for s in services: print(s) - return 0 + return ret def run(): -- cgit v1.2.3