more robust Cygwin.config: actually check Wow6432Node, prefer explicit CYGWIN_ROOT in any case;
--- a/lib/scripts/getsettings Wed Dec 09 12:26:42 2009 +0100
+++ b/lib/scripts/getsettings Wed Dec 09 16:28:49 2009 +0100
@@ -51,6 +51,7 @@
if [ "$OSTYPE" = cygwin ]; then
CLASSPATH="$(cygpath -u -p "$CLASSPATH")"
function jvmpath() { cygpath -w -p "$@"; }
+ CYGWIN_ROOT="$(jvmpath "/")"
else
function jvmpath() { echo "$@"; }
fi
--- a/src/Pure/System/cygwin.scala Wed Dec 09 12:26:42 2009 +0100
+++ b/src/Pure/System/cygwin.scala Wed Dec 09 16:28:49 2009 +0100
@@ -81,11 +81,16 @@
// new-style setup (Cygwin 1.7)
private val CYGWIN_SETUP1 = "Software\\Cygwin\\setup"
- private val CYGWIN_SETUP2 = "Software\\Wow6432Node\\Cygwin\\setup" // !?
+ private val CYGWIN_SETUP2 = "Software\\Wow6432Node\\Cygwin\\setup"
def config(): (String, String) =
{
- query_registry(CYGWIN_SETUP1, "rootdir") match {
+ val cygwin_root = java.lang.System.getenv("CYGWIN_ROOT")
+
+ (if (cygwin_root != null && cygwin_root != "") Some(cygwin_root) else None) orElse
+ query_registry(CYGWIN_SETUP1, "rootdir") orElse
+ query_registry(CYGWIN_SETUP2, "rootdir") match
+ {
case Some(root) => (root, "/cygdrive")
case None =>
val root =