Skip to content

Commit

Permalink
Fix #38 ref #8
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Feb 13, 2023
1 parent 37e077f commit ad42783
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/installation.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
needed_pkgrefs <- dep$keys()
## install all terminal nodes
for (pkgref in needed_pkgrefs) {
if(.is_github(pkgref)){
if(.is_github(pkgref)) {
noncran_pkgrefs <- c(noncran_pkgrefs, pkgref)
next()
}
Expand All @@ -54,7 +54,7 @@
while(length(setdiff(needed_pkgrefs, c(installed_pkgrefs, noncran_pkgrefs))) != 0) {
for (pkgref in needed_pkgrefs) {
##print(package)
if (!pkgref %in% installed_pkgrefs & !pkgref %in% noncran_pkgrefs) {
if (!pkgref %in% installed_pkgrefs && !pkgref %in% noncran_pkgrefs) {
## check requirement
requirement_fulfilled <- length(setdiff(dep$get(pkgref), installed_pkgrefs)) == 0
if (requirement_fulfilled) {
Expand Down
2 changes: 1 addition & 1 deletion R/resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ NULL
if (isTRUE(no_enhances)) {
disabled_types <- c(disabled_types, "Enhances")
}
res <- dep_df[!dep_df$type %in% disabled_types & dep_df$y != "R" & !(dep_df$y %in% c("datasets", "utils", "grDevices", "graphics", "stats", "methods", "tools", "grid", "splines", "Rgraphviz", "parallel", "stats4", "tcltk", "MASS", "nnet")),]
res <- dep_df[!dep_df$type %in% disabled_types & dep_df$y != "R" & !(dep_df$y %in% c("datasets", "utils", "grDevices", "graphics", "stats", "methods", "tools", "grid", "splines", "Rgraphviz", "parallel", "stats4", "tcltk", "MASS", "nnet", "class")),]
if (nrow(res) == 0) {
return(NULL)
} else {
Expand Down
Binary file added tests/testdata/issue38.RDS
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testthat/test_expost_rang.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ test_that("Docker R < 2.1", {
rang_rio$r_version <- "2.0.0"
expect_error(export_rang(rang_rio, path = temp_r))
})

test_that("issue #38", {
issue38 <- readRDS("../testdata/issue38.RDS")
expect_error(export_rang(issue38, tempfile(fileext = ".R")), NA)
})

0 comments on commit ad42783

Please sign in to comment.