CRAN PPA for R 4.0+, git listfiles.

This commit is contained in:
Andrea Dell'Amico 2021-07-02 15:52:58 +02:00
parent 97d779e028
commit 23f78b67a0
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
6 changed files with 327 additions and 126 deletions

View File

@ -11,18 +11,20 @@
#
# Set to True if you want install from the CRAN deb repository
r_install_cran_repo: False
# “Michael Rutter marutter@gmail.com” with key ID 0x51716619e084dab9
# E298A3A825C0D65DFD57CBB651716619E084DAB9
r_cran_repo_apt_key: 'E298A3A825C0D65DFD57CBB651716619E084DAB9'
# Use 'cran35' for R 3.6
r_cran_repo_version: 'cran40'
r_cran_repo_url: 'https://cloud.r-project.org/bin/linux/ubuntu {{ ansible_distribution_release }}-{{ r_cran_repo_version }}/'
# Use 'marutter/c2d4u3.5' for R 3.6
r_cran_ubuntu_packages_ppa: 'ppa:marutter/c2d4u'
r_cran_ubuntu_packages_ppa_trusty: 'ppa:marutter/c2d4u'
# 4.1, Ubuntu 18.04+
r_cran_ubuntu_packages_ppa: 'ppa:c2d4u.team/c2d4u4.0+'
r_apt_additional_repos_trusty:
- 'ppa:opencpu/jq'
r_apt_additional_repos:
- 'ppa:cran/v8'
- 'ppa:ubuntugis/ppa'
r_cran_set_default_mirror: True
r_cran_mirror_site: https://cran.mirror.garr.it/mirrors/CRAN/
r_base_specific_version: False
r_base_pkg_version: 4.0.3
r_base_pkg_version: 4.1.0
r_packages_main_state: present
r_packages_state: '{{ r_packages_main_state }}'
r_sitelib_path: '/usr/local/lib/R/site-library'
@ -30,10 +32,13 @@ r_plugins_from_deb: True
r_packages_cleanup: False
#
r_packages_updater: True
r_package_updater_via_subversion: True
r_package_updater_via_subversion: False
r_package_updater_subversion_repo: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-analysis/RConfiguration/RPackagesManagement/
r_packages_svn_base_dir: /srv/r_updater
r_packages_svn_files_prefix: ''
r_package_updater_via_git: True
r_package_updater_git_repo: 'https://code-repo.d4science.org/gCubeSystem/r-packages-list'
r_packages_git_base_dir: /srv/r_updater
r_packages_files_prefix: ''
r_packages_updater_also_upgrades_installed_packages: False
# They need to be flat text files
# 1 package per line
@ -49,47 +54,39 @@ r_packages_updater_also_upgrades_installed_packages: False
r_source_plugins_dest_dir: /var/cache/R
r_distribution_required_packages: []
# - gdal-bin
# - dans-gdal-scripts
# - libgdal1-dev
# - libgeos-dev
# - libspatialite-dev
# - proj
# - proj-bin
# - proj-data
# - libproj-dev
r_base_packages_list:
- r-base
- r-base-core
- r-base-dev
- r-base-html
- r-mathlib
r_distribution_required_packages:
- jags
- git
- subversion
- gdal-bin
- libgdal-dev
- libgeos-dev
- libspatialite-dev
- proj-bin
- proj-data
- libproj-dev
- libcurl4-openssl-dev
- texlive
- texlive-base
- texlive-binaries
- texlive-latex-base
- texlive-latex-extra
- texlive-formats-extra
- texlive-xetex
- libnetcdf-dev
- netcdf-bin
# Some packages must be put on hold
r_base_packages_hold_list: []
r_plugins_packages_list:
- jags
- r-cran-rjags
- r-cran-abind
- r-cran-boot
- r-cran-class
- r-cran-cluster
- r-cran-coda
- r-cran-codetools
- r-cran-foreign
- r-cran-lattice
- r-cran-maptools
- r-cran-mass
- r-cran-matrix
- r-cran-mgcv
- r-cran-nlme
- r-cran-nnet
- r-cran-rpart
- r-cran-sp
- r-cran-spatial
- r-cran-survival
r_apt_additional_repos:
- 'ppa:opencpu/jq'
r_plugins_packages_list: []
# RHEL/CentOS:
# http://springdale.princeton.edu/data/springdale/7/x86_64/os/Computational/
@ -113,30 +110,140 @@ r_base_packages_java_dev_el:
r_distribution_required_el_packages: []
r_cran_ubuntu_packages: []
r_cran_ubuntu_packages:
- r-cran-abind
- r-cran-askpass
- r-cran-backports
- r-cran-base64enc
- r-cran-bayesplot
- r-cran-bh
- r-cran-boot
- r-cran-bslib
- r-cran-cachem
- r-cran-callr
- r-cran-checkmate
- r-cran-class
- r-cran-cli
- r-cran-cluster
- r-cran-coda
- r-cran-codetools
- r-cran-colorspace
- r-cran-colourpicker
- r-cran-commonmark
- r-cran-cpp11
- r-cran-crayon
- r-cran-crosstalk
- r-cran-curl
- r-cran-desc
- r-cran-digest
- r-cran-dplyr
- r-cran-dt
- r-cran-dygraphs
- r-cran-ellipsis
- r-cran-fansi
- r-cran-farver
- r-cran-fastmap
- r-cran-foreign
- r-cran-fs
- r-cran-generics
- r-cran-ggplot2
- r-cran-ggridges
- r-cran-glue
- r-cran-gridextra
- r-cran-gtable
- r-cran-gtools
- r-cran-htmltools
- r-cran-htmlwidgets
- r-cran-httpuv
- r-cran-igraph
- r-cran-inline
- r-cran-isoband
- r-cran-jquerylib
- r-cran-jsonlite
- r-cran-kernsmooth
- r-cran-labeling
- r-cran-later
- r-cran-lattice
- r-cran-lazyeval
- r-cran-lifecycle
- r-cran-littler
- r-cran-lme4
- r-cran-loo
- r-cran-magrittr
- r-cran-maptools
- r-cran-markdown
- r-cran-mass
- r-cran-matrix
- r-cran-matrixstats
- r-cran-mgcv
- r-cran-mime
- r-cran-miniui
- r-cran-minqa
- r-cran-munsell
- r-cran-nlme
- r-cran-nloptr
- r-cran-nnet
- r-cran-openssl
- r-cran-packrat
- r-cran-pillar
- r-cran-pkgbuild
- r-cran-pkgconfig
- r-cran-plyr
- r-cran-prettyunits
- r-cran-processx
- r-cran-promises
- r-cran-ps
- r-cran-purrr
- r-cran-r6
- r-cran-rappdirs
- r-cran-rcolorbrewer
- r-cran-rcpp
- r-cran-rcppeigen
- r-cran-rcppparallel
- r-cran-reshape2
- r-cran-rjags
- r-cran-rlang
- r-cran-rodbc
- r-cran-rpart
- r-cran-rprojroot
- r-cran-rsconnect
- r-cran-rstan
- r-cran-rstanarm
- r-cran-rstantools
- r-cran-rstudioapi
- r-cran-sass
- r-cran-scales
- r-cran-shiny
- r-cran-shinyjs
- r-cran-shinystan
- r-cran-shinythemes
- r-cran-sourcetools
- r-cran-sp
- r-cran-spatial
- r-cran-stanheaders
- r-cran-stringi
- r-cran-stringr
- r-cran-survival
- r-cran-svglite
- r-cran-sys
- r-cran-systemfonts
- r-cran-threejs
- r-cran-tibble
- r-cran-tidyselect
- r-cran-utf8
- r-cran-v8
- r-cran-vctrs
- r-cran-viridislite
- r-cran-withr
- r-cran-xfun
- r-cran-xtable
- r-cran-xts
- r-cran-yaml
- r-cran-zoo
r_cran_install_from_sources: True
r_plugins_list_to_install: []
# - { name: 'R2WinBUGS', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'R2jags', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'bayesmix', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'coda', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'rjags', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'runjags', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'base', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'compiler', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'datasets', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'grDevices', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'graphics', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'grid', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'methods', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'parallel', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'reshape', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'splines', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'stats', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'stats4', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'tcltk', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'tools', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'utils', repo: '{{ r_cran_mirror_site }}' }
# - { name: 'robis', repo: '{{ r_cran_mirror_site }}' }
r_plugins_from_sources: []
# - { name: 'plyr', version: '1.7.1', source: 'plyr_1.7.1.tar.gz', url: 'http://cran.r-project.org/src/contrib/Archive/plyr/plyr_1.7.1.tar.gz' }

View File

@ -2,9 +2,9 @@
- import_tasks: r-packages_cleanup.yml
when:
- r_packages_cleanup
- ansible_distribution_file_variety == "Debian"
- ansible_distribution == "Ubuntu"
- import_tasks: r-installation-deb.yml
when: ansible_distribution_file_variety == "Debian"
when: ansible_distribution == "Ubuntu"
- import_tasks: r-installation-el.yml
when: ansible_distribution_file_variety == "RedHat"
- import_tasks: r-packages-install.yml

View File

@ -1,18 +1,48 @@
---
- block:
- name: Add the cran repository key
apt_key: id={{ r_cran_repo_apt_key }} keyserver=keyserver.ubuntu.com state=present
tags: [ 'r_software', 'r_repo', 'r_repo_key' ]
- name: Add the CRAN repository (Ubuntu Trusty PPA)
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa_trusty }}'
state: present
update_cache: yes
- name: Add the CRAN repository
apt_repository: repo='deb {{ r_cran_repo_url }}' state=present update_cache=yes
- name: Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic
apt_repository:
repo: '{{ item }}'
state: present
update_cache: yes
loop: '{{ r_apt_additional_repos_trusty }}'
when: r_install_cran_repo
when:
- r_install_cran_repo
- ansible_distribution_version is version_compare('14.04', '==')
tags: [ 'r_software', 'r_repo' ]
- block:
- name: Add the CRAN repository (Ubuntu Bionic PPA)
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa }}'
state: present
update_cache: yes
- name: Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic
apt_repository:
repo: '{{ item }}'
state: present
update_cache: yes
loop: '{{ r_apt_additional_repos }}'
when:
- r_install_cran_repo
- ansible_distribution_version is version_compare('18.04', '>=')
tags: [ 'r_software', 'r_repo' ]
- block:
- name: Remove the CRAN repository
apt_repository: repo='deb {{ r_cran_repo_url }}' state=absent update_cache=yes
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa }}'
state: absent
update_cache: yes
when: not r_install_cran_repo
tags: [ 'r_software', 'r_repo' ]
@ -26,7 +56,10 @@
tags: [ 'r_software', 'r_pkg', 'r_pkg_hold' ]
- name: Install the R base packages.
apt: pkg={{ r_base_packages_list }} state={{ r_packages_main_state }} update_cache=yes cache_valid_time=3600
apt:
pkg: '{{ r_base_packages_list }}'
state: '{{ r_packages_main_state }}'
cache_valid_time: 3600
- name: When we install specific R deb packages, put them on hold
shell: apt-mark hold {{ item }}
@ -36,17 +69,16 @@
tags: [ 'r_software', 'r_pkg', 'r_pkg_hold' ]
- name: Install the R additional modules from the deb repo
apt: pkg={{ r_plugins_packages_list | default([]) }} state={{ r_packages_state }} force=yes
when: r_plugins_from_deb
- name: Install some additional repositories. They provide dependencies for some R packages
apt_repository: repo={{ item }} state=present update_cache=yes
with_items: '{{ r_apt_additional_repos }}'
when: ansible_distribution_version is version_compare('18.04', '<')
tags: [ 'r_software', 'r_apt_repo', 'r_deps' ]
apt:
pkg: '{{ r_plugins_packages_list }}'
state: '{{ r_packages_state }}'
cache_valid_time: 3600
- name: Install some packages needed by R packages when installed from source
apt: pkg={{ r_distribution_required_packages | default([]) }} state={{ r_packages_state }} update_cache=yes force=yes cache_valid_time=3600
apt:
pkg: '{{ r_distribution_required_packages }}'
state: '{{ r_packages_state }}'
cache_valid_time: 3600
tags: [ 'r_software', 'r_pkg', 'r_deps' ]
tags: [ 'r_software', 'r_pkg' ]

View File

@ -1,7 +1,12 @@
---
- block:
- name: Configure the default CRAN mirror
template: src=Rprofile.site.j2 dest=/etc/R/Rprofile.site owner=root group=root mode=0444
template:
src: Rprofile.site.j2
dest: /etc/R/Rprofile.site
owner: root
group: root
mode: 0444
tags: [ 'r_software', 'r_profile', 'r_pkg' ]
- name: Configure the JDK environment
@ -14,18 +19,22 @@
tags: [ 'r_software', 'r_profile', 'r_pkg', 'r_java' ]
- name: Ensure that the R packages sources directory exists
file: dest={{ r_source_plugins_dest_dir }} state=directory owner=root group=root
file:
dest: '{{ r_source_plugins_dest_dir }}'
state: directory
owner: root
group: root
when: r_plugins_from_sources is defined
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ]
- block:
- name: Add the Ubuntu PPA '{{ r_cran_ubuntu_packages_ppa }}'
apt_repository: repo='{{ r_cran_ubuntu_packages_ppa }}' state=present update_cache=yes
- name: Install the R plugins from the Ubuntu PPA
apt: pkg={{ r_cran_ubuntu_packages }} state=present cache_valid_time=3600
apt:
pkg: '{{ r_cran_ubuntu_packages }}'
state: present
cache_valid_time: 3600
when: ansible_distribution_file_variety == "Debian"
when: ansible_distribution == "Ubuntu"
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_deb_plugins' ]
- block:

View File

@ -1,4 +1,35 @@
---
- name: Manage the subversion repository
block:
- name: Create the R packages updater SVN base directory
file:
dest: '{{ r_packages_svn_base_dir }}'
state: directory
when:
- r_cran_install_from_sources
- r_packages_updater
- r_package_updater_via_subversion
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_github', 'r_cran_pkgs', 'r_github_pkgs', 'r_packages_updater' ]
- name: Manage the git repository of the packages lists
block:
- name: Remove the R packages updater SVN base directory
file:
dest: '{{ r_packages_svn_base_dir }}/RPackagesManagement'
state: absent
- name: Create the R packages updater git base directory
file:
dest: '{{ r_packages_git_base_dir }}'
state: directory
when:
- r_cran_install_from_sources
- r_packages_updater
- r_package_updater_via_git
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_github', 'r_cran_pkgs', 'r_github_pkgs', 'r_packages_updater' ]
- block:
- name: Install the R packages updater script
template:
@ -8,11 +39,6 @@
group: root
mode: '0755'
- name: Create the R packages updater SVN base directory
file:
dest: '{{ r_packages_svn_base_dir }}'
state: directory
- name: Cron job that installs new R packages, if any
cron:
name: "install new R packages"

View File

@ -18,13 +18,23 @@ TMP_FILES_DIR=/var/tmp/r_pkgs_update
# We cannot answer questions
DEBIAN_FRONTEND=noninteractive
R_CRAN_MIRROR="{{ r_cran_mirror_site }}"
{% if r_package_updater_via_git %}
R_PKGS_FROM_SVN="False"
R_PKGS_FROM_GIT="{{ r_package_updater_via_git }}"
R_PKGS_DIR="r-packages-list"
R_PKGS_URL="{{ r_package_updater_git_repo }}"
R_PKGS_BASE_DIR="{{ r_packages_git_base_dir }}"
GIT_UPDATE_STATUS=
{% elif r_package_updater_via_subversion %}
R_PKGS_FROM_SVN="{{ r_package_updater_via_subversion }}"
R_PKGS_SVN_DIR=RPackagesManagement
R_PKGS_SVN_URL="{{ r_package_updater_subversion_repo }}"
R_PKGS_SVN_BASE_DIR="{{ r_packages_svn_base_dir }}"
R_PKGS_FILES_PREFIX="{{ r_packages_svn_files_prefix }}"
RSCRIPT_OPTIONS="--slave --no-site-file --no-init-file --no-save --no-restore-history"
R_PKGS_FROM_GIT="False"
R_PKGS_DIR=RPackagesManagement
R_PKGS_URL="{{ r_package_updater_subversion_repo }}"
R_PKGS_BASE_DIR="{{ r_packages_svn_base_dir }}"
SVN_UPDATE_STATUS=
{% endif %}
R_PKGS_FILES_PREFIX="{{ r_packages_files_prefix }}"
RSCRIPT_OPTIONS="--slave --no-site-file --no-init-file --no-save --no-restore-history"
# In seconds. 60*60*6=21600s (6h)
UPDATER_PROCESS_MAX_RUNTIME=21600
# - debian packages list format:
@ -146,21 +156,39 @@ function get_data_files() {
function get_data_files_from_svn() {
logger "update_r_packages: files from a SVN repo."
if [ -d $R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR ] ; then
if [ -d $R_PKGS_BASE_DIR/$R_PKGS_DIR ] ; then
logger "update_r_packages: SVN update"
cd $R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR
cd $R_PKGS_BASE_DIR/$R_PKGS_DIR
SVN_CLEANUP_OP=$( svn cleanup )
SVN_UPDATE_OP=$( svn update | tail -1 | grep Updated >/dev/null 2>&1 )
SVN_UPDATE_STATUS=$?
else
cd $R_PKGS_SVN_BASE_DIR
cd $R_PKGS_BASE_DIR
logger "update_r_packages: first SVN checkout."
svn co $R_PKGS_SVN_URL >/dev/null 2>&1
svn co $R_PKGS_URL >/dev/null 2>&1
fi
PKGS_LIST=$R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR/${R_PKGS_FILES_PREFIX}r_deb_pkgs.txt
R_PKGS_LIST=$R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR/${R_PKGS_FILES_PREFIX}r_cran_pkgs.txt
R_VERSIONED_PKGS_LIST=$R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR/${R_PKGS_FILES_PREFIX}r_cran_versioned_pkgs.txt
R_PKGS_GITHUB=$R_PKGS_SVN_BASE_DIR/$R_PKGS_SVN_DIR/${R_PKGS_FILES_PREFIX}r_github_pkgs.txt
PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_deb_pkgs.txt
R_PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_cran_pkgs.txt
R_VERSIONED_PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_cran_versioned_pkgs.txt
R_PKGS_GITHUB=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_github_pkgs.txt
}
function get_data_files_from_git() {
logger "update_r_packages: files from a git repo."
if [ -d $R_PKGS_BASE_DIR/$R_PKGS_DIR ] ; then
logger "update_r_packages: git pull"
cd $R_PKGS_BASE_DIR/$R_PKGS_DIR
GIT_UPDATE_OP=$( git pull | tail -1 | grep Already >/dev/null 2>&1 )
GIT_UPDATE_STATUS=$?
else
cd $R_PKGS_BASE_DIR
logger "update_r_packages: first git clone."
git clone $R_PKGS_URL >/dev/null 2>&1
fi
PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_deb_pkgs.txt
R_PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_cran_pkgs.txt
R_VERSIONED_PKGS_LIST=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_cran_versioned_pkgs.txt
R_PKGS_GITHUB=$R_PKGS_BASE_DIR/$R_PKGS_DIR/${R_PKGS_FILES_PREFIX}r_github_pkgs.txt
}
{% if ansible_distribution_file_variety == "Debian" %}
@ -174,9 +202,7 @@ function distribution_pkgs() {
logger "update_r_packages: APT cache not updated"
fi
>/var/log/update_r_debs.log
while read deb_pkg ; do
apt-get install ${deb_pkg} -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" >>/var/log/update_r_debs.log 2>&1
done < $PKGS_LIST
xargs -a $PKGS_LIST apt-get install ${deb_pkg} -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" >>/var/log/update_r_debs.log 2>&1
apt-get autoremove -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" >> /var/log/update_r_debs.log 2>&1
else
logger "update_r_packages: skipping the debian packages installation"
@ -194,12 +220,6 @@ function distribution_pkgs() {
if [ $EL_PKGS_SKIP -eq 0 ] ; then
# Update the apt cache and install the packages in non interactive mode
logger "update_r_packages: Installing the EL dependencies"
if [ -z "$(find /var/cache/apt/pkgcache.bin -mmin -360)" ]; then
apt-get update -q >/dev/null 2>&1
else
logger "update_r_packages: APT cache not updated"
fi
>/var/log/update_r_debs.log
while read el_pkg ; do
yum -y install ${el_pkg} >>/var/log/update_r_el.log 2>&1
done < $PKGS_LIST
@ -261,10 +281,10 @@ function r_github_pkgs() {
for l in $( cat $R_PKGS_GITHUB ) ; do
pkg=$( echo $l | cut -d "/" -f 2 )
if [ "$ACTION" == "upgrade" ] ; then
Rscript $RSCRIPT_OPTIONS -e "require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='always')"
Rscript $RSCRIPT_OPTIONS -e "require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='false')"
else
Rscript $RSCRIPT_OPTIONS -e "if (! ('$pkg' %in% installed.packages()[,'Package'])) { require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='always') }"
Rscript $RSCRIPT_OPTIONS -e "if (! ('$pkg' %in% installed.packages()[,'Package'])) { require(devtools); require(methods); require(jsonlite) ; package_to_install <- '$l' ; refs <- jsonlite::read_json(sprintf('https://api.github.com/repos/%s/releases', package_to_install)) ; ref_to_install <- 'master'; if(length(refs)>0) { ref_to_install <- refs[[1]][['tag_name']] } ; devtools::install_github(package_to_install, ref = ref_to_install, upgrade='false') }"
fi
done
else
@ -279,7 +299,14 @@ function r_github_pkgs() {
usage
get_args
init_env
if [ $R_PKGS_FROM_SVN == 'True' ] ; then
if [ $R_PKGS_FROM_GIT == 'True' ] ; then
get_data_files_from_git
if [ $GIT_UPDATE_STATUS -ne 1 -a "$ACTION" == "install" ] ; then
logger "update_r_packages: nothing new to install from git, exiting"
cleanup
exit 0
fi
elif [ $R_PKGS_FROM_SVN == 'True' ] ; then
get_data_files_from_svn
if [ $SVN_UPDATE_STATUS -ne 0 -a "$ACTION" == "install" ] ; then
logger "update_r_packages: nothing new to install from SVN, exiting"