@@ -9,11 +9,12 @@ install_recheck_deps <- function(path = '.', which = 'strong'){
9
9
oldrepos <- enable_all_repos()
10
10
oldtimeout <- options(timeout = 600 )
11
11
on.exit(options(c(oldrepos , oldtimeout )), add = TRUE )
12
- desc <- read.dcf(file.path(path , ' DESCRIPTION' ))
13
- pkg <- desc [[ 1 , ' Package' ]]
12
+ desc <- as.data.frame( read.dcf(file.path(path , ' DESCRIPTION' ) ))
13
+ pkg <- desc $ Package
14
14
cranrepo <- getOption(' repos' )[' CRAN' ]
15
15
cran <- utils :: available.packages(repos = cranrepo )
16
- packages <- c(pkg , tools :: package_dependencies(pkg , db = cran , which = which , reverse = TRUE )[[pkg ]])
16
+ crandeps <- tools :: package_dependencies(pkg , db = cran , which = which , reverse = TRUE )[[pkg ]]
17
+ packages <- unique(c(desc_deps(desc ), crandeps ))
17
18
if (grepl(" Linux" , Sys.info()[[' sysname' ]])){
18
19
preinstall_linux_binaries(packages )
19
20
} else {
@@ -22,3 +23,8 @@ install_recheck_deps <- function(path = '.', which = 'strong'){
22
23
update.packages(oldPkgs = deps , ask = FALSE )
23
24
}
24
25
}
26
+
27
+ desc_deps <- function (desc ){
28
+ deps <- c(desc $ Package , desc $ Depends , desc $ Imports , desc $ LinkingTo , desc $ Suggests , desc $ Enhances )
29
+ unique(trimws(sub(" \\ (.*\\ )" , " " , unlist(strsplit(as.character(deps ), ' ,' )))))
30
+ }
0 commit comments