This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch release/4.0.5.1-1-osx in repository x2goclient. commit 68cc2486b4dbca21ce358ef57e1b6e03f59d295c Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 6 06:55:33 2016 +0200 src/onmainwindow.cpp: add (default) MacPorts prefix, /usr/local/bin and /opt/X11/bin to x2goclient's environment and child environments before starting xmodmap. Fixes: #1019. Requires a re-release of X2Go Client for OS X. --- debian/changelog | 11 +++++++++++ src/onmainwindow.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/debian/changelog b/debian/changelog index 995b6dd..d0c76bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +x2goclient (4.0.5.1-0x2go2) unstable; urgency=medium + + [ Mihai Moldovan ] + * Hotfix release for OS X (4.0.5.1): + - src/onmainwindow.cpp: add (default) MacPorts prefix, /usr/local/bin and + /opt/X11/bin to x2goclient's environment and child environments before + starting xmodmap. Fixes: #1019. Requires a re-release of X2Go Client for + OS X. + + -- Mihai Moldovan <ionic@ionic.de> Wed, 06 Apr 2016 17:10:10 +0100 + x2goclient (4.0.5.1-0x2go1) unstable; urgency=low [ Mihai Moldovan ] diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index be4de32..1239634 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -5620,6 +5620,56 @@ void ONMainWindow::slotSetModMap() path_val = "/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/opt/X11/bin"; tmp_env.insert ("PATH", path_val); } + else { + /* FIXME: split/clean this up. */ + /* Search for and add /opt/X11/bin if necessary. */ + QStringList tmp_path = path_val.split (":"); + bool xquartz_found = false, + macports_found = false, + local_found = false; + for (int i = 0; i < tmp_path.length (); ++i) { + if ((tmp_path[i] == QString ("/opt/X11/bin")) || (tmp_path[i] == QString ("/opt/X11/bin/"))) { + xquartz_found = true; + continue; + } + + if ((tmp_path[i] == QString ("/opt/local/bin")) || (tmp_path[i] == QString ("/opt/local/bin/"))) { + macports_found = true; + continue; + } + + + if ((tmp_path[i] == QString ("/usr/local/bin")) || (tmp_path[i] == QString ("/usr/local/bin/"))) { + local_found = true; + continue; + } + + if (xquartz_found && macports_found && local_found) { + break; + } + } + + if (!xquartz_found) { + path_val.append (":/opt/X11/bin"); + } + + if (!local_found) { + path_val.prepend ("/usr/local/bin:"); + } + + if (!macports_found) { + path_val.prepend ("/opt/local/bin:"); + } + + /* Insert will overwrite the value automatically. */ + tmp_env.insert ("PATH", path_val); + + /* + * Also alter our own environment so we can actually + * execute xmodmap and friends later on. + */ + qputenv ("PATH", path_val.toUtf8 ()); + } pr.setProcessEnvironment (tmp_env); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git