1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

nightly: only use read_config to load final, generated config.py

This needs to use the config loading routine to find Java `keytool`, but
since it doesn't need to fully load the config, isolate that usage in the
function.  Then read_config() is only ever called once, as is it meant to
be used, once the config.py is generated.

Using `from . import common; common.config = foo` will not always work,
due to some oddities to how the `from` imports work. So the full module
has to be imported in order to make sure its always properly set.
This commit is contained in:
Hans-Christoph Steiner 2017-12-01 10:07:21 +01:00
parent 8a61b0b945
commit bf913703c5

View File

@ -51,7 +51,9 @@ def _ssh_key_from_debug_keystore():
privkey = os.path.join(tmp_dir, '.privkey')
key_pem = os.path.join(tmp_dir, '.key.pem')
p12 = os.path.join(tmp_dir, '.keystore.p12')
subprocess.check_call([common.config['keytool'], '-importkeystore',
_config = dict()
common.fill_config_defaults(_config)
subprocess.check_call([_config['keytool'], '-importkeystore',
'-srckeystore', KEYSTORE_FILE, '-srcalias', KEY_ALIAS,
'-srcstorepass', PASSWORD, '-srckeypass', PASSWORD,
'-destkeystore', p12, '-destalias', KEY_ALIAS,
@ -91,7 +93,6 @@ def main():
help=_("Don't use rsync checksums"))
# TODO add --with-btlog
options = parser.parse_args()
common.read_config(None)
# force a tighter umask since this writes private key material
umask = os.umask(0o077)