Skip to content

Commit

Permalink
Merge pull request #783 from maksymiuks/main
Browse files Browse the repository at this point in the history
Add additional_repositories to dev_package_deps
  • Loading branch information
gaborcsardi authored Feb 26, 2024
2 parents 6fe8836 + b839583 commit b9091cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* Remotes field accepts explicit package names: `<pkgname>=<type>::<username>/<repo>` (#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

Expand Down
7 changes: 5 additions & 2 deletions R/deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 5 additions & 1 deletion man/package_deps.Rd

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

0 comments on commit b9091cc

Please sign in to comment.