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,6 +171,8 @@ def check_tags(app, pattern):
|
|||||||
else:
|
else:
|
||||||
filecontent = tag
|
filecontent = tag
|
||||||
|
|
||||||
|
vercode = tag
|
||||||
|
if codeex:
|
||||||
m = re.search(codeex, filecontent)
|
m = re.search(codeex, filecontent)
|
||||||
if not m:
|
if not m:
|
||||||
continue
|
continue
|
||||||
|
@ -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