@@ -30,18 +30,11 @@ if command -v R &>/dev/null; then
3030 if [[ -n " $R_REPOSITORY " ]] || [[ -n " $PACKAGE_MANAGER_URL " ]]; then
3131 echo " configuration r (add local repository)"
3232
33- # /!\ Possible regression point for other users depending on this code.
34- # The rocker image used as base injects a repository based on the CRAN environment variable, see for instance
35- # https://github.com/rocker-org/rocker-versioned2/blob/677573589638617e04cad971ceafef84d5004f10/scripts/setup_R.sh#L34
36- # This behavior might be unwanted when using an internal repository (eg: Nexus) instead of the public Posit
37- # Package Manager instance. As such, when the PACKAGE_MANAGER_URL variable is set, we should overwrite
38- # the Rprofile.site instead of appending to it. But as there might be unforeseen use cases where this
39- # change could trigger problems, so I'm flagging this as such.
33+ # When the PACKAGE_MANAGER_URL variable is set, overwrite the Rprofile.site originating from the rocker image
34+ # (but still keep the UserAgent setting in case some internal repositories need it)
4035 if [[ -n " $PACKAGE_MANAGER_URL " ]]; then
4136 echo ' # Rocker default configuration removed by /opt/onyxia-set-repositories.sh' > ${R_HOME} /etc/Rprofile.site
4237
43- # The unwanted behavior is setting options("repos"), but we might want to keep the user agent change from Rocker,
44- # as this can potentially be used depending on how the local package manager is configured.
4538 echo ' # https://docs.rstudio.com/rspm/admin/serving-binaries/#binaries-r-configuration-linux' >> ${R_HOME} /etc/Rprofile.site
4639 echo ' options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' >> ${R_HOME} /etc/Rprofile.site
4740 fi
@@ -53,11 +46,8 @@ if command -v R &>/dev/null; then
5346 if [[ -n " $PACKAGE_MANAGER_URL " ]]; then
5447
5548 UBUNTU_CODENAME=$( cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)
56- # Moving from "/__linux__/" style URLs to "/bin/linux" style URLS for PACKAGE_MANAGER_URL,
57- # as this allows easier management for local package managers (at least Nexus, where it allows
58- # using a single repository as opposed to one per major.minor version of R)
49+ # Using "/bin/linux" style URLS for PACKAGE_MANAGER_URL allows easier management for local package managers (eg: Nexus)
5950 # See also : https://docs.posit.co/rspm/admin/serving-binaries.html#using-linux-binary-packages
60- # echo " r[\"PackageManager\"] <- \"${PACKAGE_MANAGER_URL}/${UBUNTU_CODENAME}/latest\"" >> ${R_HOME}/etc/Rprofile.site
6151 echo " r[\" PackageManager\" ] <- sprintf(\" ${PACKAGE_MANAGER_URL} /latest/bin/linux/${UBUNTU_CODENAME} -%s/%s\" , R.version[\" arch\" ], substr(getRversion(), 1, 3))" >> ${R_HOME} /etc/Rprofile.site
6252 fi
6353
0 commit comments