mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
Merge branch 'pwd-path-fix' into 'master'
Avoid zero-length prefixes in PATH See merge request fdroid/fdroidserver!1113
This commit is contained in:
commit
14beedd6e8
2 changed files with 9 additions and 1 deletions
|
|
@ -3006,7 +3006,7 @@ def set_FDroidPopen_env(build=None):
|
||||||
if build is not None:
|
if build is not None:
|
||||||
path = build.ndk_path()
|
path = build.ndk_path()
|
||||||
paths = orig_path.split(os.pathsep)
|
paths = orig_path.split(os.pathsep)
|
||||||
if path not in paths:
|
if path and path not in paths:
|
||||||
paths = [path] + paths
|
paths = [path] + paths
|
||||||
env['PATH'] = os.pathsep.join(paths)
|
env['PATH'] = os.pathsep.join(paths)
|
||||||
for n in ['ANDROID_NDK', 'NDK', 'ANDROID_NDK_HOME']:
|
for n in ['ANDROID_NDK', 'NDK', 'ANDROID_NDK_HOME']:
|
||||||
|
|
|
||||||
|
|
@ -2364,6 +2364,14 @@ class CommonTest(unittest.TestCase):
|
||||||
"%s_%s.exe" % (app.id, build.versionCode),
|
"%s_%s.exe" % (app.id, build.versionCode),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_no_zero_length_ndk_path_prefixes(self):
|
||||||
|
fdroidserver.common.config = {'ndk_paths': {}}
|
||||||
|
build = fdroidserver.metadata.Build()
|
||||||
|
|
||||||
|
os.environ['PATH'] = '/usr/bin:/usr/sbin'
|
||||||
|
fdroidserver.common.set_FDroidPopen_env(build)
|
||||||
|
self.assertNotIn('', os.getenv('PATH').split(os.pathsep))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(os.path.dirname(__file__))
|
os.chdir(os.path.dirname(__file__))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue