1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-02 09:10:11 +02:00

Apply suggestion from @uniqx to using shutil.which instead of iterating path by hand

This commit is contained in:
Cyril Russo 2018-08-17 20:14:54 +02:00
parent ace33bcfc0
commit 4303b0fac1

View File

@ -236,17 +236,10 @@ def fill_config_defaults(thisconfig):
thisconfig['keytool'] = os.path.join(java_home, 'bin', 'keytool')
break
if 'jarsigner' not in thisconfig:
for path in os.environ['PATH'].split(':'):
jarsigner = os.path.join(path, 'jarsigner')
if os.path.exists(jarsigner):
thisconfig['jarsigner'] = jarsigner
else:
continue
keytool = os.path.join(path, 'keytool')
if os.path.exists(keytool):
thisconfig['keytool'] = keytool
break
thisconfig['jarsigner'] = shutil.which('jarsigner')
thisconfig['keytool'] = shutil.which('keytool')
for k in ['ndk_paths', 'java_paths']:
d = thisconfig[k]