mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 10:40:12 +02:00
build-tools TODO is unnecessary. fix vercodes.
This commit is contained in:
parent
9efa52276d
commit
05735e9fca
@ -416,7 +416,7 @@ def parse_metadata(metafile, **kw):
|
|||||||
thisbuild['version'] = parts[0]
|
thisbuild['version'] = parts[0]
|
||||||
thisbuild['vercode'] = parts[1]
|
thisbuild['vercode'] = parts[1]
|
||||||
try:
|
try:
|
||||||
testvercode = int(thisbuild['vercode'])
|
thisbuild['vercode'] = int(thisbuild['vercode'])
|
||||||
except:
|
except:
|
||||||
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
raise MetaDataException("Invalid version code for build in " + metafile.name)
|
||||||
thisbuild['commit'] = parts[2]
|
thisbuild['commit'] = parts[2]
|
||||||
@ -617,7 +617,7 @@ def write_metadata(dest, app):
|
|||||||
# Keeping the original formatting if we loaded it from a file...
|
# Keeping the original formatting if we loaded it from a file...
|
||||||
mf.write('\\\n'.join(build['origlines']) + '\n')
|
mf.write('\\\n'.join(build['origlines']) + '\n')
|
||||||
else:
|
else:
|
||||||
mf.write(build['version'] + ',' + build['vercode'] + ',' +
|
mf.write(build['version'] + ',' + str(build['vercode']) + ',' +
|
||||||
build['commit'])
|
build['commit'])
|
||||||
for key,value in build.iteritems():
|
for key,value in build.iteritems():
|
||||||
if key not in ['version', 'vercode', 'commit']:
|
if key not in ['version', 'vercode', 'commit']:
|
||||||
@ -861,7 +861,7 @@ def parse_androidmanifest(app_dir):
|
|||||||
if not vercode:
|
if not vercode:
|
||||||
matches = vcsearch(line)
|
matches = vcsearch(line)
|
||||||
if matches:
|
if matches:
|
||||||
vercode = matches.group(1)
|
vercode = int(matches.group(1))
|
||||||
if version:
|
if version:
|
||||||
return (version, vercode, package)
|
return (version, vercode, package)
|
||||||
for xmlfile in glob.glob(app_dir + '/res/values/strings*transl*.xml'):
|
for xmlfile in glob.glob(app_dir + '/res/values/strings*transl*.xml'):
|
||||||
@ -1116,7 +1116,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path,
|
|||||||
raise BuildException("Failed to amend manifest")
|
raise BuildException("Failed to amend manifest")
|
||||||
if 'forcevercode' in build:
|
if 'forcevercode' in build:
|
||||||
if subprocess.call(['sed','-r','-i',
|
if subprocess.call(['sed','-r','-i',
|
||||||
's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g',
|
's/android:versionCode="[^"]+"/android:versionCode="' + str(build['vercode']) + '"/g',
|
||||||
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
'AndroidManifest.xml'], cwd=root_dir) !=0:
|
||||||
raise BuildException("Failed to amend manifest")
|
raise BuildException("Failed to amend manifest")
|
||||||
|
|
||||||
@ -1490,7 +1490,6 @@ def isApkDebuggable(apkfile, sdk_path):
|
|||||||
:param apkfile: full path to the apk to check
|
:param apkfile: full path to the apk to check
|
||||||
:param sdk_path: path to android sdk"""
|
:param sdk_path: path to android sdk"""
|
||||||
|
|
||||||
# TODO: use new build-tools path
|
|
||||||
p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
|
p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
|
||||||
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
|
@ -86,8 +86,7 @@ def update_wiki(apps, apks, verbose=False):
|
|||||||
if thisbuild['vercode'] == app['Current Version Code']:
|
if thisbuild['vercode'] == app['Current Version Code']:
|
||||||
cantupdate = True
|
cantupdate = True
|
||||||
apklist.append({
|
apklist.append({
|
||||||
#TODO: Nasty: vercode is a string in the build, and an int elsewhere
|
'versioncode': thisbuild['vercode'],
|
||||||
'versioncode': int(thisbuild['vercode']),
|
|
||||||
'version': thisbuild['version'],
|
'version': thisbuild['version'],
|
||||||
'buildproblem': thisbuild['commit'][1:]
|
'buildproblem': thisbuild['commit'][1:]
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user