Skip to content

Commit

Permalink
allow installing package dependencies from single repo (fixes #1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Dec 1, 2017
1 parent fcad56c commit 3c99f02
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/cpp/session/modules/ModuleTools.R
@@ -1,7 +1,7 @@
#
# ModuleTools.R
#
# Copyright (C) 2009-15 by RStudio, Inc.
# Copyright (C) 2009-17 by RStudio, Inc.
#
# Unless you have received this program directly from RStudio pursuant
# to the terms of a commercial license agreement with RStudio, then
Expand Down Expand Up @@ -121,19 +121,17 @@
# the repos option is canonically a named character vector, but could also
# be a named list
if (is.character(repos) || is.list(repos)) {
if (is.null(names(repos))) {
# no indication of which repo is which, presume the first entry to be
# CRAN if it's of character type
if (length(repos) > 0 && is.character(repos[[1]]))
repo <- repos[[1]]
} else {
# use repo named CRAN
repo <- as.character(repos["CRAN"])
# check for a repo named "CRAN"
repo <- as.character(repos["CRAN"])

# if no repo named "CRAN", blindly guess that the first repo is a CRAN mirror
if (length(repo) < 1 || is.na(repo)) {
repo <- as.character(repos[[1]])
}
}

# if no default repo and no repo marked CRAN, give up
if (is.na(repo)) {
if (length(repo) < 1 || is.na(repo)) {
return(list(version = "", satisfied = FALSE))
}

Expand Down

0 comments on commit 3c99f02

Please sign in to comment.