Skip to content

Commit

Permalink
Do not rewrite "both" package type to "binary"
Browse files Browse the repository at this point in the history
Because it makes it impossible to fall back to
source packages. Instead, just follow the default
behavior, i.e. observe the install.packages.compile.from.source
options and the corresponding environment variable.
  • Loading branch information
gaborcsardi committed Feb 28, 2018
1 parent 7840905 commit d3a6766
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 31 deletions.
11 changes: 2 additions & 9 deletions R/deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
#' @param quiet If \code{TRUE}, suppress output.
#' @param upgrade If \code{TRUE}, also upgrade any of out date dependencies.
#' @param repos A character vector giving repositories to use.
#' @param type Type of package to \code{update}. If "both", will switch
#' automatically to "binary" to avoid interactive prompts during package
#' installation.
#' @param type Type of package to \code{update}.
#'
#' @param object A \code{package_deps} object.
#' @param ... Additional arguments passed to \code{install_packages}.
Expand Down Expand Up @@ -51,10 +49,6 @@ package_deps <- function(packages, dependencies = NA,
repos = getOption("repos"),
type = getOption("pkgType")) {

if (identical(type, "both")) {
type <- "binary"
}

repos <- fix_repositories(repos)
cran <- available_packages(repos, type)

Expand Down Expand Up @@ -277,8 +271,7 @@ update.package_deps <- function(object, ..., quiet = FALSE, upgrade = TRUE) {
install_packages <- function(packages, repos = getOption("repos"),
type = getOption("pkgType"), ...,
dependencies = FALSE, quiet = NULL) {
if (identical(type, "both"))
type <- "binary"

if (is.null(quiet))
quiet <- !identical(type, "source")

Expand Down
4 changes: 1 addition & 3 deletions man/install_deps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/package_deps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/update_packages.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions tests/testthat/test-install-github.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,6 @@ test_that("github_pull", {
"pkgsnap")
})

test_that("type = 'both' works well", {

skip_on_cran()
skip_if_offline()
skip_if_over_rate_limit()

expect_equal(
package_deps("falsy", type = "both"),
package_deps("falsy", type = "binary")
)

})

## -2 = not installed, but available on CRAN
## -1 = installed, but out of date
## 0 = installed, most recent version
Expand Down

2 comments on commit d3a6766

@Steffireise
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helped me a lot! With the current version of the remotes package on CRAN, I was unable to install a package from GitHub that depended on Bioconductor annotation packages; as those are always installed from source. With this updated version from GitHub, the issue is solved! It would be great to have this bug fixed on the CRAN version as well.

@rabutler-usbr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this is a huge help and would be great to have it available on CRAN. It will allow AppVeyor to work with PKGTYPE: both. Thanks!

Please sign in to comment.