From: Michael Tremer Date: Fri, 10 Jul 2020 10:43:46 +0000 (+0000) Subject: location(8): Allow downloading a database without one on disk X-Git-Tag: 0.9.3~3 X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Flibloc.git;a=commitdiff_plain;h=2201d9043d3172f83abbe48fbeb464e2fbe98da0 location(8): Allow downloading a database without one on disk Signed-off-by: Michael Tremer --- diff --git a/src/python/location.in b/src/python/location.in index c4987a5..5189738 100644 --- a/src/python/location.in +++ b/src/python/location.in @@ -199,9 +199,14 @@ class CLI(object): try: db = location.Database(args.database) except FileNotFoundError as e: - sys.stderr.write("location: Could not open database %s: %s\n" \ - % (args.database, e)) - sys.exit(1) + # Allow continuing without a database + if args.func == self.handle_update: + db = None + + else: + sys.stderr.write("location: Could not open database %s: %s\n" \ + % (args.database, e)) + sys.exit(1) # Translate family (if present) if "family" in args: