use all captured groups in UpdateCheckData
Hi
Currently I'm trying to write a build metadata for electrum project, which I am facing some issues due to automatic versionCode generation,
which leads me to use of UpdateCheckData to use a file to create a versionCode
currently first regex group is used, it would be nice if we could use all the capture groups to create the versionCode, which would open up new ways to capture version code for passing to VercodeOperation
currently what I am aiming to achieve is something like this:
AutoUpdateMode: Version
UpdateCheckMode: Tags ^[\d.]+$
UpdateCheckData: electrum/version.py|APK_VERSION\s*=\s*'(\d+)\.(\d+)\.(\d+)\.(\d+)'|.|APK_VERSION\s*=\s*'(.+)'
VercodeOperation:
- 'int("3" + str(%c)[0] + "0" + str(%c)[1] + "0" + str(%c)[2] + "0" + str(%c)[3])'
- 'int("2" + str(%c)[0] + "0" + str(%c)[1] + "0" + str(%c)[2] + "0" + str(%c)[3])'
- 'int("4" + str(%c)[0] + "0" + str(%c)[1] + "0" + str(%c)[2] + "0" + str(%c)[3])'
CurrentVersion: 4.5.5.0
CurrentVersionCode: 44050500
the suggested solution for that line looks like this:
vercode = ''.join(m.groups()).strip()
This can be a breaking change, depending on how regex in the metadata files has been written so far, so it should be considered carefully
Edited by thecockatiel