refactor env handling for FDroidPopen to support .fdroid.* metadata

The start up sequence of processes that are based on the .fdroid.* metadata
is a bit different, so this ensures that the environment variables get
properly initialized in all cases.

This also creates a single function where the environment is set.  Before
it was being set in multiple places across multiple files.
This commit is contained in:
Hans-Christoph Steiner 2015-08-05 14:39:58 +02:00
parent 9abb80b3b7
commit 3768d7a4d6
6 changed files with 47 additions and 24 deletions

View file

@ -472,13 +472,7 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
logging.critical("Android NDK '%s' is not a directory!" % ndk_path)
sys.exit(3)
# Set up environment vars that depend on each build
for n in ['ANDROID_NDK', 'NDK', 'ANDROID_NDK_HOME']:
common.env[n] = ndk_path
common.reset_env_path()
# Set up the current NDK to the PATH
common.add_to_env_path(ndk_path)
common.set_FDroidPopen_env(build)
# Prepare the source code...
root_dir, srclibpaths = common.prepare_source(vcs, app, build,