diff --git a/NEWS.md b/NEWS.md index d33edeb6..88a6983e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,9 +6,11 @@ * Remotes field accepts explicit package names: `=::/` (#719, @heavywatal). * Add `remote_precedence` parameter to `dev_package_deps()` which allows user to choose whether remote sources should have a priority over cran sources. (#732, @maksymiuks) - * `dev_package_deps()` now works for packages with `Enhances` dependencies (#711, @maksymiuks). +* Add `additional_repositories` parameter to `dev_package_deps()` which allows user to choose whether + `Additional_repositories` should be extracted from the `DESCRIPTION` file and appended + to repos. (#782, @maksymiuks) # remotes 2.4.2 diff --git a/R/deps.R b/R/deps.R index 4ed4f064..13d1c873 100644 --- a/R/deps.R +++ b/R/deps.R @@ -34,6 +34,8 @@ #' @param type Type of package to `update`. #' @param remote_precedence A logical flag specifying whether remote sources should take precedence over #' CRAN when both were found. +#' @param additional_repositories A logical flag specifying whether `Additional_repositories` should +#' be extracted from the DESCRIPTION and appended to `repos`. #' @param object A `package_deps` object. #' @param ... Additional arguments passed to `install_packages`. #' @inheritParams install_github @@ -124,10 +126,11 @@ local_package_deps <- function(pkgdir = ".", dependencies = NA) { dev_package_deps <- function(pkgdir = ".", dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), - remote_precedence = TRUE) { + remote_precedence = TRUE, + additional_repositories = TRUE) { pkg <- load_pkg_description(pkgdir) - repos <- c(repos, parse_additional_repositories(pkg)) + repos <- c(repos, if (additional_repositories) parse_additional_repositories(pkg)) deps <- local_package_deps(pkgdir = pkgdir, dependencies = dependencies) diff --git a/man/package_deps.Rd b/man/package_deps.Rd index 5abfc65d..67be6455 100644 --- a/man/package_deps.Rd +++ b/man/package_deps.Rd @@ -21,7 +21,8 @@ dev_package_deps( dependencies = NA, repos = getOption("repos"), type = getOption("pkgType"), - remote_precedence = TRUE + remote_precedence = TRUE, + additional_repositories = TRUE ) \method{update}{package_deps}( @@ -69,6 +70,9 @@ common ones include: \item{remote_precedence}{A logical flag specifying whether remote sources should take precedence over CRAN when both were found.} +\item{additional_repositories}{A logical flag specifying whether \code{Additional_repositories} should +be extracted from the DESCRIPTION and appended to \code{repos}.} + \item{object}{A \code{package_deps} object.} \item{upgrade}{Should package dependencies be upgraded? One of "default", "ask", "always", or "never". "default"