diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 5e2d58bd..fb9d734b 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -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