From f58b1b1fcb83c7409693f2c897427a3e44a97d5a Mon Sep 17 00:00:00 2001 From: maksymis <32574056+maksymiuks@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:53:39 +0100 Subject: [PATCH 1/2] Add additional_repositories parameter --- NEWS.md | 4 +++- R/deps.R | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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) From b83958396d4bbbf37a5c028307a1d5668b009905 Mon Sep 17 00:00:00 2001 From: maksymis <32574056+maksymiuks@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:57:09 +0100 Subject: [PATCH 2/2] Update docuemntation --- man/package_deps.Rd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"