From 7f168d34d2e68835962169593e351c69fc8b141e Mon Sep 17 00:00:00 2001 From: Bisaloo Date: Thu, 7 Jun 2018 11:13:34 +0200 Subject: [PATCH 1/2] Fix installation instructions for multiple missing packages --- R/install_packages.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/install_packages.R b/R/install_packages.R index df4dea72..b893d034 100644 --- a/R/install_packages.R +++ b/R/install_packages.R @@ -89,7 +89,7 @@ install_packages_cran <- function(packages, instructions=FALSE) { return(character(0)) } if (instructions) { - sprintf("install.packages(%s)", + sprintf("install.packages(c(%s))", paste(dquote(packages), collapse=", ")) } else { ## This is super annoying but means that we'll hopefully get From febd9942cbccba05632b6150b429b3e7dc4910b9 Mon Sep 17 00:00:00 2001 From: Bisaloo Date: Thu, 7 Jun 2018 11:24:31 +0200 Subject: [PATCH 2/2] Update install.packages tests to use c() --- tests/testthat/test-install-packages.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-install-packages.R b/tests/testthat/test-install-packages.R index b8fded4b..4f8770aa 100644 --- a/tests/testthat/test-install-packages.R +++ b/tests/testthat/test-install-packages.R @@ -15,7 +15,7 @@ test_that("sources", { test_that("install_packages", { extras <- read_remake_packages("remake_sources.yml") - cmp_devtools_cran <- 'install.packages("devtools")' + cmp_devtools_cran <- 'install.packages(c("devtools"))' expect_equal(install_packages("devtools", TRUE, FALSE, extras), cmp_devtools_cran) expect_equal(install_packages("sowsear", TRUE, FALSE, extras), @@ -57,7 +57,7 @@ test_that("loading a remakefile with a missing package", { cleanup() obj <- suppressWarnings(remake("remake_missing_package.yml")) expect_error(.remake_initialize_packages(obj), - 'install.packages("nosuchpackage")', fixed=TRUE) + 'install.packages(c("nosuchpackage"))', fixed=TRUE) skip_unless_set("REMAKE_TEST_INSTALL_PACKAGES") expect_warning(m <- remake("remake_missing_package.yml", allow_cache=FALSE),