Skip to content

Commit

Permalink
Also get deps from current version
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
jeroen committed Aug 21, 2024
1 parent 61c486a commit 34e3a26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rechecktools/R/ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ install_recheck_deps <- function(path = '.', which = 'strong'){
pkg <- desc[[1, 'Package']]
cranrepo <- getOption('repos')['CRAN']
cran <- utils::available.packages(repos = cranrepo)
packages <- c(pkg, tools::package_dependencies(pkg, db = cran, which = which, reverse = TRUE)[[pkg]])
crandeps <- tools::package_dependencies(pkg, db = cran, which = which, reverse = TRUE)[[pkg]]
packages <- unique(c(desc_deps(desc), crandeps))
if(grepl("Linux", Sys.info()[['sysname']])){
preinstall_linux_binaries(packages)
} else {
Expand All @@ -22,3 +23,8 @@ install_recheck_deps <- function(path = '.', which = 'strong'){
update.packages(oldPkgs = deps, ask = FALSE)
}
}

desc_deps <- function(desc){
deps <- c(desc$Package, desc$Depends, desc$Imports, desc$LinkingTo, desc$Suggests, desc$Enhances)
unique(trimws(sub("\\(.*\\)", "", unlist(strsplit(as.character(deps), ',')))))
}

0 comments on commit 34e3a26

Please sign in to comment.