chiark / gitweb /
Translate disabled commit to proper disabled
authorCiaran Gultnieks <ciaran@ciarang.com>
Sun, 27 Oct 2013 14:35:57 +0000 (14:35 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Sun, 27 Oct 2013 14:35:57 +0000 (14:35 +0000)
fdroidserver/common.py

index 5e2d58bdadfe0b56881e1de0f8f2646820824861..fb9d734be860b49e1410ec5ddf371f5daba2086c 100644 (file)
@@ -472,7 +472,19 @@ def parse_metadata(metafile, verbose=False):
             testvercode = int(thisbuild['vercode'])
         except:
             raise MetaDataException("Invalid version code for build in " + metafile.name)
-        thisbuild['commit'] = parts[2]
+        if parts[2].startswith('!'):
+            # For backwards compatibility, handle old-style disabling,
+            # including attempting to extract the commit from the message
+            thisbuild['disabled'] = parts[2]
+            commit = 'unknown - see disabled'
+            index = parts[2].rfind('at ')
+            if index != -1:
+                commit = parts[2][index+3:]
+                if commit.endswith(')'):
+                    commit = commit[:-1]
+            thisbuild['commit'] = commit
+        else:
+            thisbuild['commit'] = parts[2]
         for p in parts[3:]:
             pk, pv = p.split('=', 1)
             thisbuild[pk.strip()] = pv