diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2021-04-29 10:57:23 +0200 |
|---|---|---|
| committer | Lars-Dominik Braun <ldb@leibniz-psychology.org> | 2021-05-03 09:16:26 +0200 |
| commit | be28ecc87513350f61d3c1549df6845a96880f34 (patch) | |
| tree | 4ede3ca5b9d37fb3532e0b18ee687fc8a327974d /patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch | |
| parent | 7f44609c6607347695fcbedd3c5511aa7f6a3fd4 (diff) | |
guix-science: Add rstudio-server-multi-version.
* guix-science/packages/rstudio.scm (rstudio-server-multi-version):
New variable.
*
patches/rstudio-server-multi-version/0001-handleClientInit-Store-R-versions-in-sessionInfo.patch,
patches/rstudio-server-multi-version/0002-sessionProcessConfig-Configure-R-version-from-active.patch,
patches/rstudio-server-multi-version/0003-NewProjectWizard-Unhide-version-selector-widget.patch,
patches/rstudio-server-multi-version/0004-handleConnection-Switch-R-version-when-switching-pro.patch,
patches/rstudio-server-multi-version/0005-Add-version-switcher-widget-to-toolbar.patch,
patches/rstudio-server-multi-version/0006-Look-at-.local-share-rstudio-r-versions-for-custom-R.patch,
patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch:
New files.
Diffstat (limited to 'patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch')
| -rw-r--r-- | patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch b/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch new file mode 100644 index 0000000..96eb6aa --- /dev/null +++ b/patches/rstudio-server-multi-version/0007-detectRLocationsUsingR-Restore-R_HOME-at-the-end.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From 36ed7d1c0036d40798a3ab5045f365e8e33692f3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ricardo Wurmus <rekado@elephly.net> | ||
| 3 | Date: Sun, 20 Dec 2020 14:49:51 +0100 | ||
| 4 | Subject: [PATCH 7/7] detectRLocationsUsingR: Restore R_HOME at the end. | ||
| 5 | |||
| 6 | This is not needed when detectRLocationsUsingR is only called by the | ||
| 7 | server process; for the multi-version feature, however, the rsession | ||
| 8 | process is calling it, and its R_HOME may not be unset. | ||
| 9 | --- | ||
| 10 | src/cpp/core/r_util/REnvironmentPosix.cpp | 3 +++ | ||
| 11 | 1 file changed, 3 insertions(+) | ||
| 12 | |||
| 13 | diff --git a/src/cpp/core/r_util/REnvironmentPosix.cpp b/src/cpp/core/r_util/REnvironmentPosix.cpp | ||
| 14 | index 83b60d7a1b..a909631e25 100644 | ||
| 15 | --- a/src/cpp/core/r_util/REnvironmentPosix.cpp | ||
| 16 | +++ b/src/cpp/core/r_util/REnvironmentPosix.cpp | ||
| 17 | @@ -489,6 +489,7 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, | ||
| 18 | // (the normal semantics of invoking the R script are that it overwrites | ||
| 19 | // R_HOME and prints a warning -- this warning is co-mingled with the | ||
| 20 | // output of R and messes up our parsing) | ||
| 21 | + std::string oldRHome = core::system::getenv("R_HOME"); | ||
| 22 | core::system::setenv("R_HOME", ""); | ||
| 23 | |||
| 24 | // if no R path was specified for a module, the module binary path MUST be specified | ||
| 25 | @@ -598,6 +599,8 @@ bool detectRLocationsUsingR(const std::string& rScriptPath, | ||
| 26 | return false; | ||
| 27 | } | ||
| 28 | |||
| 29 | + // restore R_HOME | ||
| 30 | + core::system::setenv("R_HOME", oldRHome); | ||
| 31 | return true; | ||
| 32 | } | ||
| 33 | #endif | ||
| 34 | -- | ||
| 35 | 2.31.1 | ||
| 36 | |||
