mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
[checkupdates] UpdateCheckData tag for verocode if no regex
Use the tag as the version code if no regex was specified. This allows: UpdateCheckData: '|||' meaning the tag should be used for version code and name.
This commit is contained in:
parent
0c484f927e
commit
cebdcdd67c
@ -171,11 +171,13 @@ def check_tags(app, pattern):
|
|||||||
else:
|
else:
|
||||||
filecontent = tag
|
filecontent = tag
|
||||||
|
|
||||||
m = re.search(codeex, filecontent)
|
vercode = tag
|
||||||
if not m:
|
if codeex:
|
||||||
continue
|
m = re.search(codeex, filecontent)
|
||||||
|
if not m:
|
||||||
|
continue
|
||||||
|
|
||||||
vercode = m.group(1).strip()
|
vercode = m.group(1).strip()
|
||||||
|
|
||||||
if filever:
|
if filever:
|
||||||
if filever != '.':
|
if filever != '.':
|
||||||
|
@ -265,6 +265,13 @@ class CheckupdatesTest(unittest.TestCase):
|
|||||||
self.assertEqual(vername, '1.1.0')
|
self.assertEqual(vername, '1.1.0')
|
||||||
self.assertEqual(vercode, '1')
|
self.assertEqual(vercode, '1')
|
||||||
|
|
||||||
|
app.UpdateCheckData = '|||'
|
||||||
|
vcs.latesttags.return_value = ['2']
|
||||||
|
with mock.patch('fdroidserver.common.getvcs', return_value=vcs):
|
||||||
|
vername, vercode, _tag = fdroidserver.checkupdates.check_tags(app, None)
|
||||||
|
self.assertEqual(vername, '2')
|
||||||
|
self.assertEqual(vercode, '2')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
|
Loading…
Reference in New Issue
Block a user