Skip to content

Commit 9cf2e56

Browse files
committed
Accept args 'lib' and 'INSTALL_opts' in 'install.fastr.packages'.
1 parent 89ebfae commit 9cf2e56

File tree

1 file changed

+7
-3
lines changed
  • com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/R

1 file changed

+7
-3
lines changed

com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/R/utils.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ eval(expression({
2525

2626
fastrRepoPath <- NULL
2727

28-
install.fastr.packages <- function(pkgs) {
28+
install.fastr.packages <- function(pkgs, lib, INSTALL_opts=character(0)) {
2929
if (is.null(fastrRepoPath) || !file.exists(fastrRepoPath)) {
3030
workDir <- tempdir()
3131
download.file('https://api.github.com/repos/oracle/fastr/tarball/master', file.path(workDir, 'fastr-repo.tar.gz'))
@@ -37,7 +37,11 @@ eval(expression({
3737
for (pkg in pkgs) {
3838
pkgPath <- file.path(fastrRepoPath, 'com.oracle.truffle.r.pkgs', pkg)
3939
if (file.exists(pkgPath)) {
40-
install.packages(pkgPath, repos=NULL)
40+
if (missing(lib)) {
41+
install.packages(pkgPath, repos=NULL, INSTALL_opts=INSTALL_opts)
42+
} else {
43+
install.packages(pkgPath, lib=lib, repos=NULL, INSTALL_opts=INSTALL_opts)
44+
}
4145
} else {
4246
stop(paste0("FastR doesn't provide patched version of package ", pkg, ". Use install.packages to install it."));
4347
}
@@ -92,4 +96,4 @@ eval(expression({
9296

9397
# export new public functions
9498
exports <- asNamespace("utils")[[".__NAMESPACE__."]][['exports']]
95-
assign('install.fastr.packages', 'install.fastr.packages', envir = exports)
99+
assign('install.fastr.packages', 'install.fastr.packages', envir = exports)

0 commit comments

Comments
 (0)