changeset 14553:6fb61ad67962

Fix mx eclipseformat always adds the 'eclipse' suffix
author Gilles Duboscq <duboscq@ssw.jku.at>
date Sun, 16 Mar 2014 19:20:21 +0100
parents 2c78ee2a890f
children 29f47f2c6388
files mxtool/mx.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Sun Mar 16 18:52:14 2014 +0100
+++ b/mxtool/mx.py	Sun Mar 16 19:20:21 2014 +0100
@@ -1894,10 +1894,13 @@
         abort('Could not find Eclipse executable. Use -e option or ensure ECLIPSE_EXE environment variable is set.')
 
     # Maybe an Eclipse installation dir was specified - look for the executable in it
-    if join(args.eclipse_exe, exe_suffix('eclipse')):
+    if isdir(args.eclipse_exe):
         args.eclipse_exe = join(args.eclipse_exe, exe_suffix('eclipse'))
-
-    if not os.path.isfile(args.eclipse_exe) or not os.access(args.eclipse_exe, os.X_OK):
+        warn("The eclipse-exe was a directory, now using " + args.eclipse_exe)
+
+    if not os.path.isfile(args.eclipse_exe):
+        abort('File does not exist: ' + args.eclipse_exe)
+    if not os.access(args.eclipse_exe, os.X_OK):
         abort('Not an executable file: ' + args.eclipse_exe)
 
     eclipseinit([], buildProcessorJars=False)