chiark / gitweb /
lint: warn about CVCs that don't make sense
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 14 Aug 2015 21:16:43 +0000 (14:16 -0700)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 14 Aug 2015 21:16:43 +0000 (14:16 -0700)
fdroidserver/lint.py

index 675782fff2c42a9149225e0b6500f2a3331019e0..12a7900a5763b6ab217e9eaf220948203b008f59 100644 (file)
@@ -147,8 +147,15 @@ def main():
         curid = appid
         count['app_total'] += 1
 
+        # enabled_builds = 0
+        lowest_vercode = -1
         curbuild = None
         for build in app['builds']:
+            if not build['disable']:
+                # enabled_builds += 1
+                vercode = int(build['vercode'])
+                if lowest_vercode == -1 or vercode < lowest_vercode:
+                    lowest_vercode = vercode
             if not curbuild or int(build['vercode']) > int(curbuild['vercode']):
                 curbuild = build
 
@@ -181,6 +188,10 @@ def main():
                     ]):
                 warn("UCM is set but it looks like checkupdates hasn't been run yet")
 
+        cvc = int(app['Current Version Code'])
+        if cvc > 0 and cvc < lowest_vercode:
+            warn("Current Version Code is lower than any enabled build")
+
         # Missing or incorrect categories
         if not app['Categories']:
             warn("Categories are not set")