Skip to content

Commit bee893b

Browse files
committed
Revert dev_package_deps new arguments
It breaks the devtools package.
1 parent 82da608 commit bee893b

6 files changed

+21
-71
lines changed

NEWS.md

-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
credential store, if `GITHUB_PAT` and `GITHUB_TOKEN` are not set.
55
* The `Remotes` field in `DESCRIPTION` now accepts explicit package names:
66
`<pkgname>=<type>::<username>/<repo>` (#719, @heavywatal).
7-
* `dev_package_deps()` noq has a `remote_precedence` parameter which allows
8-
the user to choose whether remote sources should have a priority over
9-
CRAN sources (#732, @maksymiuks).
107
* `dev_package_deps()` now works for packages with `Enhances` dependencies
118
(#711, @maksymiuks).
12-
* `dev_package_deps()` now has an `additional_repositories` parameter
13-
which allows the user to choose whether `Additional_repositories` should
14-
be extracted from the `DESCRIPTION` file and appended to repos
15-
(#782, @maksymiuks).
169
* `install_dev()` now ignores a trailing slash (#692, @krlmlr).
1710
* System requirements now support Ubuntu 22.04.
1811
* `local_package_deps()` now errors for non-existent directories

R/deps.R

+6-17
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
#' "always" and "never" respectively.
3333
#' @param repos A character vector giving repositories to use.
3434
#' @param type Type of package to `update`.
35-
#' @param remote_precedence A logical flag specifying whether remote sources should take precedence over
36-
#' CRAN when both were found.
37-
#' @param additional_repositories A logical flag specifying whether `Additional_repositories` should
38-
#' be extracted from the DESCRIPTION and appended to `repos`.
35+
#'
3936
#' @param object A `package_deps` object.
4037
#' @param ... Additional arguments passed to `install_packages`.
4138
#' @inheritParams install_github
@@ -125,12 +122,10 @@ local_package_deps <- function(pkgdir = ".", dependencies = NA) {
125122

126123
dev_package_deps <- function(pkgdir = ".", dependencies = NA,
127124
repos = getOption("repos"),
128-
type = getOption("pkgType"),
129-
remote_precedence = TRUE,
130-
additional_repositories = TRUE) {
125+
type = getOption("pkgType")) {
131126

132127
pkg <- load_pkg_description(pkgdir)
133-
repos <- c(repos, if (additional_repositories) parse_additional_repositories(pkg))
128+
repos <- c(repos, parse_additional_repositories(pkg))
134129

135130
deps <- local_package_deps(pkgdir = pkgdir, dependencies = dependencies)
136131

@@ -145,14 +140,14 @@ dev_package_deps <- function(pkgdir = ".", dependencies = NA,
145140

146141
cran_deps <- package_deps(deps, repos = repos, type = type)
147142

148-
res <- combine_remote_deps(cran_deps, extra_deps(pkg, "remotes"), remote_precedence)
143+
res <- combine_remote_deps(cran_deps, extra_deps(pkg, "remotes"))
149144

150145
res <- do.call(rbind, c(list(res), lapply(get_extra_deps(pkg, dependencies), extra_deps, pkg = pkg), stringsAsFactors = FALSE))
151146

152147
res[is.na(res$package) | !duplicated(res$package, fromLast = TRUE), ]
153148
}
154149

155-
combine_remote_deps <- function(cran_deps, remote_deps, remote_precedence) {
150+
combine_remote_deps <- function(cran_deps, remote_deps) {
156151
# If there are no dependencies there will be no remote dependencies either,
157152
# so just return them (and don't force the remote_deps promise)
158153
if (nrow(cran_deps) == 0) {
@@ -163,13 +158,7 @@ combine_remote_deps <- function(cran_deps, remote_deps, remote_precedence) {
163158
remote_deps <- remote_deps[is.na(remote_deps$package) | remote_deps$package %in% cran_deps$package, ]
164159

165160
# If there are remote deps remove the equivalent CRAN deps
166-
if (remote_precedence) {
167-
cran_deps <- cran_deps[!(cran_deps$package %in% remote_deps$package), ]
168-
# Otherwise remove remotes already covered by CRAN
169-
} else {
170-
remote_deps <- remote_deps[!(remote_deps$package %in% cran_deps$package), ]
171-
}
172-
161+
cran_deps <- cran_deps[!(cran_deps$package %in% remote_deps$package), ]
173162

174163
rbind(remote_deps, cran_deps)
175164
}

inst/install-github.R

+6-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install-github.R

+6-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/install_bitbucket.Rd

+2-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/package_deps.Rd

+1-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)