Lenard Lindstrom committed 32f4900

Update for MSYS 1.0.13 root directory search

Comments (0)

Files changed (3)

 """MSYS specifics for Msys terminal IO and for running shell scripts
+Configured for MSYS 1.0.13.
 exports msys_raw_input, MsysException, Msys
+Uses optional environment variable MSYS_ROOT_DIRECTORY. Set this to the full
+path of the MSYS home directory, 1.0 subdirectory in path optional.
 from msysio import raw_input_ as msys_raw_input, print_ as msys_print
     The return value is an encoded ascii str. The registry entry for the
     uninstaller is used. Raise a LookupError if not found.
+    #!! Leave until known if new MSYS package manager makes a registry entry.
     subkey = (
             return as_shell(dir_path)
-        shell = os.environ['SHELL']
+        shell = os.environ['MSYS_ROOT_DIRECTORY']
     except KeyError:
-        if is_msys():
-            return shell + '.exe'
-        return shell
+        if not'[\\/]1\.[0-9]', shell):
+            shell = os.path.join(shell, '1.0')
+        return os.path.join(shell, 'bin', 'sh.exe')
+    if is_msys():
+        try:
+            return os.environ['WD'] + os.environ['MSYSCON']
+        except KeyError:
+            pass
         dir_path = find_msys_registry()

 The recognized, and optional, environment variables are:
   PREFIX - Destination directory
-  SHELL - MSYS shell program path - already defined in the MSYS terminal
+  MSYS_ROOT_DIRECTORY - MSYS home directory (may omit 1.0 subdirectory)
   LDFLAGS - linker options - prepended to flags set by the program
   CPATH - C/C++ header file paths - appended to the paths used by this program
 msys-automake-1.8.2 (?)
-nasm-2.08.01-win32 (needed (replace with yasm)?)
-yasm (1.0.1) (Prefered over nasm by SDL 1.2.14 configure?)
+yasm (1.0.1)
 plus numerous other dependencies to still be sorted out when the the new
   MinGW installer is available (Hopefully there will be an Msys installer as well.)
     except msys.MsysException:
         return 1
+    print_("Using MSYS in directory:", m.msys_root)
     start_time = None
     return_code = 1
     set_environment_variables(m, options)
     """Return true if the execution environment is MSYS"""
-        return os.environ['OSTYPE'] == 'msys'
+        # Unfortunately there is no longer an MSYS specific identifier.
+        return os.environ['TERM'] == 'cygwin'
     except KeyError:
         return False