1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Put version name match back how it was (c2168db3d) because it's broken

This commit is contained in:
Ciaran Gultnieks 2013-05-21 15:51:02 +01:00
parent d832bf8e9e
commit fb8bd8e892

View File

@ -232,11 +232,10 @@ def scan_apks(apps, apkcache, repodir, knownapks):
shutil.rmtree(icon_dir) shutil.rmtree(icon_dir)
if not os.path.exists(icon_dir): if not os.path.exists(icon_dir):
os.makedirs(icon_dir) os.makedirs(icon_dir)
apks = [] apks = []
name_pat = re.compile(".*name='([a-zA-Z0-9._]*)'.*") name_pat = re.compile(".*name='([a-zA-Z0-9._]*)'.*")
vercode_pat = re.compile(".*versionCode='([0-9]*)'.*") vercode_pat = re.compile(".*versionCode='([0-9]*)'.*")
vername_pat = re.compile(".*versionName='(.*)'[\n '].*") vername_pat = re.compile(".*versionName='([^']*)'.*")
label_pat = re.compile(".*label='(.*)'[\n '].*") label_pat = re.compile(".*label='(.*)'[\n '].*")
icon_pat = re.compile(".*icon='([^']*)'.*") icon_pat = re.compile(".*icon='([^']*)'.*")
sdkversion_pat = re.compile(".*'([0-9]*)'.*") sdkversion_pat = re.compile(".*'([0-9]*)'.*")
@ -276,9 +275,14 @@ def scan_apks(apps, apkcache, repodir, knownapks):
sys.exit(1) sys.exit(1)
for line in output.splitlines(): for line in output.splitlines():
if line.startswith("package:"): if line.startswith("package:"):
thisinfo['id'] = re.match(name_pat, line).group(1) try:
thisinfo['versioncode'] = int(re.match(vercode_pat, line).group(1)) thisinfo['id'] = re.match(name_pat, line).group(1)
thisinfo['version'] = re.match(vername_pat, line).group(1) thisinfo['versioncode'] = int(re.match(vercode_pat, line).group(1))
thisinfo['version'] = re.match(vername_pat, line).group(1)
except Exception, e:
print "Package matching failed: " + str(e)
print "Line was: " + line
sys.exit(1)
elif line.startswith("application:"): elif line.startswith("application:"):
thisinfo['name'] = re.match(label_pat, line).group(1) thisinfo['name'] = re.match(label_pat, line).group(1)
thisinfo['iconsrc'] = re.match(icon_pat, line).group(1) thisinfo['iconsrc'] = re.match(icon_pat, line).group(1)