chiark / gitweb /
Add -l/--latest to fdroid build
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 17 May 2013 18:44:15 +0000 (20:44 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 17 May 2013 18:44:15 +0000 (20:44 +0200)
fdroidserver/build.py

index 7540d53f0046bdd778c90e9c08a1f2cea79c55f0..a8693aca31749b83636466454593144bca349c62 100644 (file)
@@ -512,6 +512,8 @@ def parse_commandline():
                       help="Build only the specified package")
     parser.add_option("-c", "--vercode", default=None,
                       help="Build only the specified version code")
+    parser.add_option("-l", "--latest", action="store_true", default=False,
+                      help="Build only the latest version code available")
     parser.add_option("-s", "--stop", action="store_true", default=False,
                       help="Make the build stop on exceptions")
     parser.add_option("-t", "--test", action="store_true", default=False,
@@ -622,6 +624,10 @@ def main():
         for app in apps:
             app['builds'] = [b for b in app['builds']
                     if str(b['vercode']) == options.vercode]
+    elif options.latest:
+        for app in apps:
+            m = max([i['vercode'] for i in app['builds']], key=int)
+            app['builds'] = [b for b in app['builds'] if b['vercode'] == m]
 
     # Build applications...
     failed_apps = {}