From: Daniel Martí Date: Wed, 30 Mar 2016 21:54:37 +0000 (+0100) Subject: Fix build crash introduced in 3768d7a4 X-Git-Tag: 0.7.0~71 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e822627fd1c586ae39388321170de794c2770980;p=fdroidserver.git Fix build crash introduced in 3768d7a4 get_ndk_path was removed long ago when App and Build were introduced. Now Build.ndk_path() should be used. Trying to use the object as a dict resulted in a nasty crash: TypeError: 'Build' object is not subscriptable This is probably a result from faulty rebasing and not enough test coverage. --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index acaeaffd..6dd33713 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -262,21 +262,6 @@ def read_config(opts, config_file='config.py'): return config -def get_ndk_path(version): - if config is None or 'ndk_paths' not in config: - ndk_path = os.getenv('ANDROID_NDK_HOME') - if ndk_path is None: - logging.error('No NDK found! Either set ANDROID_NDK_HOME or add ndk_path to your config.py') - else: - return ndk_path - if version is None: - version = 'r10e' # falls back to latest - paths = config['ndk_paths'] - if version not in paths: - return '' - return paths[version] or '' - - def find_sdk_tools_cmd(cmd): '''find a working path to a tool from the Android SDK''' @@ -1834,7 +1819,7 @@ def set_FDroidPopen_env(build=None): def replace_config_vars(cmd, build): cmd = cmd.replace('$$SDK$$', config['sdk_path']) - cmd = cmd.replace('$$NDK$$', get_ndk_path(build['ndk'])) + cmd = cmd.replace('$$NDK$$', build.ndk_path()) cmd = cmd.replace('$$MVN3$$', config['mvn3']) if build is not None: cmd = cmd.replace('$$COMMIT$$', build.commit)