mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Check javac existence when looking for JDK
Empty JDK directories can remain from previous JDK installations. For example in RHEL/Fedora when RPM upgrades a package it can leave modified files (usually configs) and, consequently, their directories. So we could end up selecting a bad JDK path.
This commit is contained in:
parent
07660fdb13
commit
162808a4cc
1 changed files with 3 additions and 5 deletions
|
@ -158,11 +158,9 @@ def fill_config_defaults(thisconfig):
|
||||||
m = re.match(regex, j)
|
m = re.match(regex, j)
|
||||||
if not m:
|
if not m:
|
||||||
continue
|
continue
|
||||||
osxhome = os.path.join(d, 'Contents', 'Home')
|
for p in [d, os.path.join(d, 'Contents', 'Home')]:
|
||||||
if os.path.exists(osxhome):
|
if os.path.exists(os.path.join(p, 'bin', 'javac')):
|
||||||
thisconfig['java_paths'][m.group(1)] = osxhome
|
thisconfig['java_paths'][m.group(1)] = p
|
||||||
else:
|
|
||||||
thisconfig['java_paths'][m.group(1)] = d
|
|
||||||
|
|
||||||
for java_version in ('7', '8', '9'):
|
for java_version in ('7', '8', '9'):
|
||||||
if java_version not in thisconfig['java_paths']:
|
if java_version not in thisconfig['java_paths']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue