mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Merge branch 'master' of gitorious.org:f-droid/fdroidserver
This commit is contained in:
commit
887e754170
@ -345,7 +345,8 @@ def main():
|
|||||||
elif mode == 'RepoManifest':
|
elif mode == 'RepoManifest':
|
||||||
(version, vercode) = check_repomanifest(app)
|
(version, vercode) = check_repomanifest(app)
|
||||||
elif mode.startswith('RepoManifest/'):
|
elif mode.startswith('RepoManifest/'):
|
||||||
(version, vercode) = check_repomanifest(app, mode[13:])
|
tag = mode[13:]
|
||||||
|
(version, vercode) = check_repomanifest(app, tag)
|
||||||
elif mode == 'RepoTrunk':
|
elif mode == 'RepoTrunk':
|
||||||
(version, vercode) = check_repotrunk(app)
|
(version, vercode) = check_repotrunk(app)
|
||||||
elif mode == 'HTTP':
|
elif mode == 'HTTP':
|
||||||
|
@ -1355,6 +1355,8 @@ def getsrclib(spec, srclib_dir, basepath=False, raw=False, prepare=True, preponl
|
|||||||
raise BuildException("Failed to update srclib project {0}"
|
raise BuildException("Failed to update srclib project {0}"
|
||||||
.format(name), p.stdout, p.stderr)
|
.format(name), p.stdout, p.stderr)
|
||||||
|
|
||||||
|
remove_signing_keys(libdir)
|
||||||
|
|
||||||
if basepath:
|
if basepath:
|
||||||
return sdir
|
return sdir
|
||||||
return libdir
|
return libdir
|
||||||
@ -1457,18 +1459,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
|||||||
raise BuildException("Failed to update project at %s" % d,
|
raise BuildException("Failed to update project at %s" % d,
|
||||||
p.stdout, p.stderr)
|
p.stdout, p.stderr)
|
||||||
|
|
||||||
# If the app has ant set up to sign the release, we need to switch
|
remove_signing_keys(build_dir)
|
||||||
# that off, because we want the unsigned apk...
|
|
||||||
for propfile in ('build.properties', 'default.properties', 'ant.properties'):
|
|
||||||
if os.path.exists(os.path.join(root_dir, propfile)):
|
|
||||||
if subprocess.call(['sed','-i','s/^key.store/#/',
|
|
||||||
propfile], cwd=root_dir) !=0:
|
|
||||||
raise BuildException("Failed to amend %s" % propfile)
|
|
||||||
for root, dirs, files in os.walk(build_dir):
|
|
||||||
for f in files:
|
|
||||||
if f == 'build.gradle':
|
|
||||||
clean_gradle_keys(os.path.join(root, f))
|
|
||||||
break
|
|
||||||
|
|
||||||
# Update the local.properties file...
|
# Update the local.properties file...
|
||||||
localprops = [ os.path.join(build_dir, 'local.properties') ]
|
localprops = [ os.path.join(build_dir, 'local.properties') ]
|
||||||
@ -1941,26 +1932,42 @@ def FDroidPopen(commands, cwd=None):
|
|||||||
result.returncode = p.returncode
|
result.returncode = p.returncode
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def clean_gradle_keys(path):
|
def remove_signing_keys(build_dir):
|
||||||
if options.verbose:
|
for root, dirs, files in os.walk(build_dir):
|
||||||
print "Cleaning build.gradle of keysigning configs at %s" % path
|
if 'build.gradle' in files:
|
||||||
|
path = os.path.join(root, 'build.gradle')
|
||||||
|
|
||||||
lines = None
|
if options.verbose:
|
||||||
with open(path, "r") as o:
|
print "Cleaning build.gradle of keysigning configs at %s" % path
|
||||||
lines = o.readlines()
|
|
||||||
|
with open(path, "r") as o:
|
||||||
opened = 0
|
lines = o.readlines()
|
||||||
with open(path, "w") as o:
|
|
||||||
for line in lines:
|
opened = 0
|
||||||
if 'signingConfigs ' in line:
|
with open(path, "w") as o:
|
||||||
opened = 1
|
for line in lines:
|
||||||
elif opened > 0:
|
if 'signingConfigs ' in line:
|
||||||
if '{' in line:
|
opened = 1
|
||||||
opened += 1
|
elif opened > 0:
|
||||||
elif '}' in line:
|
if '{' in line:
|
||||||
opened -=1
|
opened += 1
|
||||||
elif not any(s in line for s in (' signingConfig ',)):
|
elif '}' in line:
|
||||||
o.write(line)
|
opened -=1
|
||||||
|
elif not any(s in line for s in (
|
||||||
|
' signingConfig ',
|
||||||
|
'android.signingConfigs.',
|
||||||
|
'variant.outputFile = ')):
|
||||||
|
o.write(line)
|
||||||
|
|
||||||
|
for propfile in ('build.properties', 'default.properties', 'ant.properties'):
|
||||||
|
if propfile in files:
|
||||||
|
if options.verbose:
|
||||||
|
print "Cleaning %s of keysigning configs at %s" % (propfile,path)
|
||||||
|
path = os.path.join(root, propfile)
|
||||||
|
with open(path, "w") as o:
|
||||||
|
for line in lines:
|
||||||
|
if not line.startswith('key.store'):
|
||||||
|
o.write(line)
|
||||||
|
|
||||||
def replace_config_vars(cmd):
|
def replace_config_vars(cmd):
|
||||||
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
|
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
|
||||||
|
@ -220,7 +220,7 @@ def main():
|
|||||||
src_dir = os.path.join(tmp_dir, 'importer')
|
src_dir = os.path.join(tmp_dir, 'importer')
|
||||||
if os.path.exists(src_dir):
|
if os.path.exists(src_dir):
|
||||||
shutil.rmtree(src_dir)
|
shutil.rmtree(src_dir)
|
||||||
vcs = common.getvcs(repotype, repo, src_dir, config['sdk_path'])
|
vcs = common.getvcs(repotype, repo, src_dir)
|
||||||
vcs.gotorevision(options.rev)
|
vcs.gotorevision(options.rev)
|
||||||
if options.subdir:
|
if options.subdir:
|
||||||
root_dir = os.path.join(src_dir, options.subdir)
|
root_dir = os.path.join(src_dir, options.subdir)
|
||||||
|
Loading…
Reference in New Issue
Block a user