1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-02 07:20:37 +02:00

make config optional when using common.set_FDroidPopen_env()

common.set_FDroidPopen_env() is used to call git and other tools that
are not part of the Android SDK nor require Java, so the items that
are being set from the config are optional.  This lets plugins do
quite a bit without ever setting up a config.
This commit is contained in:
Hans-Christoph Steiner 2021-01-11 13:15:33 +01:00
parent 4b7d29097d
commit d36f71e048
2 changed files with 6 additions and 8 deletions

View File

@ -14,10 +14,6 @@ fdroid_summary = 'prepare the srclibs for `fdroid build --on-server`'
def main():
common.config = {
'sdk_path': os.getenv('ANDROID_HOME'),
}
common.fill_config_defaults(common.config)
parser = argparse.ArgumentParser(usage="%(prog)s [options] [APPID[:VERCODE] [APPID[:VERCODE] ...]]")
common.setup_global_opts(parser)
parser.add_argument("appid", nargs='*', help=_("applicationId with optional versionCode in the form APPID[:VERCODE]"))

View File

@ -2741,10 +2741,12 @@ def set_FDroidPopen_env(build=None):
if env is None:
env = os.environ
orig_path = env['PATH']
for n in ['ANDROID_HOME', 'ANDROID_SDK']:
env[n] = config['sdk_path']
for k, v in config['java_paths'].items():
env['JAVA%s_HOME' % k] = v
if config:
if config.get('sdk_path'):
for n in ['ANDROID_HOME', 'ANDROID_SDK']:
env[n] = config['sdk_path']
for k, v in config.get('java_paths', {}).items():
env['JAVA%s_HOME' % k] = v
missinglocale = True
for k, v in env.items():