Skip to content

Commit

Permalink
now located in r-minimal/Rprofile.site
Browse files Browse the repository at this point in the history
  • Loading branch information
ihiverlet committed Oct 13, 2023
1 parent bde51ea commit eb8a354
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions scripts/onyxia-set-repositories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,3 @@ if [ "`which conda`" != "" ]; then
fi
fi

if command -v R; then
if [[ -n "$R_REPOSITORY" ]] || [[ -n "$PACKAGE_MANAGER_URL" ]]; then
echo "configuration r (add local repository)"

echo '# https://docs.rstudio.com/rspm/admin/serving-binaries/#binaries-r-configuration-linux' > ${R_HOME}/etc/Rprofile.site
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
echo '# Proxy repository for R' >> ${R_HOME}/etc/Rprofile.site
echo 'local({' >> ${R_HOME}/etc/Rprofile.site
echo ' r <- getOption("repos")' >> ${R_HOME}/etc/Rprofile.site

if [[ -n "$PACKAGE_MANAGER_URL" ]]; then
UBUNTU_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)
echo " r[\"PackageManager\"] <- \"${PACKAGE_MANAGER_URL}/${UBUNTU_CODENAME}/latest\"" >> ${R_HOME}/etc/Rprofile.site
fi

if [[ -n "$R_REPOSITORY" ]]; then
echo " r[\"LocalRepository\"] <- \"${R_REPOSITORY}\"" >> ${R_HOME}/etc/Rprofile.site
fi

echo ' options(repos = r)' >> ${R_HOME}/etc/Rprofile.site
echo '})' >> ${R_HOME}/etc/Rprofile.site

# Unsure if this last line below should be inside this is ;
# leaving it here for now, but should be reviewed before.

# Configure renv to use the specified package repository
echo 'options(renv.config.repos.override = getOption("repos"))' >> ${R_HOME}/etc/Rprofile.site
fi

fi

0 comments on commit eb8a354

Please sign in to comment.