]> git.ipfire.org Git - location/libloc.git/commitdiff
location-downloader: Exit with 3 when the database was already up to date
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Dec 2019 20:15:58 +0000 (20:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Dec 2019 20:15:58 +0000 (20:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
man/location-downloader.txt
src/python/location-downloader.in

index 5faa5cd2ca83fc9e1ab7c130e22504269f9c0401..93b27fb85532d76655ad990856d28c2e96138085 100644 (file)
@@ -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.
index f0acb236f09af7d100b7a56e21891b3595a3f038..a9b74dbbe449b560561e147b4efcaa5382d55d85 100644 (file)
@@ -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