From f47a500fff39c375531ef41f70e091ef2b139afb Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 9 Dec 2019 20:15:58 +0000 Subject: [PATCH] location-downloader: Exit with 3 when the database was already up to date Signed-off-by: Michael Tremer --- man/location-downloader.txt | 4 ++++ src/python/location-downloader.in | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/man/location-downloader.txt b/man/location-downloader.txt index 5faa5cd..93b27fb 100644 --- a/man/location-downloader.txt +++ b/man/location-downloader.txt @@ -26,6 +26,10 @@ location database. 'update':: This command will try to update the local database. + + + It will terminate with a return code of zero if the database has been + successfully updated. 1 on error, 2 on invalid call and 3 if the + database was already the latest version. '--help':: Shows a short help text on using this program. diff --git a/src/python/location-downloader.in b/src/python/location-downloader.in index f0acb23..a9b74db 100644 --- a/src/python/location-downloader.in +++ b/src/python/location-downloader.in @@ -328,7 +328,7 @@ class CLI(object): # If we have not received a new file, there is nothing to do if not t: - return 0 + return 3 # Write temporary file to destination shutil.copyfile(t.name, ns.database) @@ -336,6 +336,8 @@ class CLI(object): # Remove temporary file os.unlink(t.name) + return 0 + def main(): # Run the command line interface -- 2.47.3