chiark / gitweb /
common: always set android ndk env vars
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 16 Jun 2016 20:36:31 +0000 (21:36 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 16 Jun 2016 20:36:31 +0000 (21:36 +0100)
Also, add the ndk to PATH at the beginning, in case any other ndks are
already in it.

Fixes #176.

fdroidserver/common.py

index 03a8743d2686efd73b807be1361b741e4ebcd237..aa673e778189390db939a1ef166f0585515e905b 100644 (file)
@@ -1805,16 +1805,12 @@ def set_FDroidPopen_env(build=None):
         for k, v in config['java_paths'].items():
             env['JAVA%s_HOME' % k] = v
 
-    # Set up environment vars that depend on each build, only set the
-    # NDK env vars if the NDK is not already in the PATH
     if build is not None:
         path = build.ndk_path()
         paths = orig_path.split(os.pathsep)
-        if path in paths:
-            return
-        paths.append(path)
-        env['PATH'] = os.pathsep.join(paths)
-
+        if path not in paths:
+            paths = [path] + paths
+            env['PATH'] = os.pathsep.join(paths)
         for n in ['ANDROID_NDK', 'NDK', 'ANDROID_NDK_HOME']:
             env[n] = build.ndk_path()