32
32
# ' "always" and "never" respectively.
33
33
# ' @param repos A character vector giving repositories to use.
34
34
# ' @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
+ # '
39
36
# ' @param object A `package_deps` object.
40
37
# ' @param ... Additional arguments passed to `install_packages`.
41
38
# ' @inheritParams install_github
@@ -125,12 +122,10 @@ local_package_deps <- function(pkgdir = ".", dependencies = NA) {
125
122
126
123
dev_package_deps <- function (pkgdir = " ." , dependencies = NA ,
127
124
repos = getOption(" repos" ),
128
- type = getOption(" pkgType" ),
129
- remote_precedence = TRUE ,
130
- additional_repositories = TRUE ) {
125
+ type = getOption(" pkgType" )) {
131
126
132
127
pkg <- load_pkg_description(pkgdir )
133
- repos <- c(repos , if ( additional_repositories ) parse_additional_repositories(pkg ))
128
+ repos <- c(repos , parse_additional_repositories(pkg ))
134
129
135
130
deps <- local_package_deps(pkgdir = pkgdir , dependencies = dependencies )
136
131
@@ -145,14 +140,14 @@ dev_package_deps <- function(pkgdir = ".", dependencies = NA,
145
140
146
141
cran_deps <- package_deps(deps , repos = repos , type = type )
147
142
148
- res <- combine_remote_deps(cran_deps , extra_deps(pkg , " remotes" ), remote_precedence )
143
+ res <- combine_remote_deps(cran_deps , extra_deps(pkg , " remotes" ))
149
144
150
145
res <- do.call(rbind , c(list (res ), lapply(get_extra_deps(pkg , dependencies ), extra_deps , pkg = pkg ), stringsAsFactors = FALSE ))
151
146
152
147
res [is.na(res $ package ) | ! duplicated(res $ package , fromLast = TRUE ), ]
153
148
}
154
149
155
- combine_remote_deps <- function (cran_deps , remote_deps , remote_precedence ) {
150
+ combine_remote_deps <- function (cran_deps , remote_deps ) {
156
151
# If there are no dependencies there will be no remote dependencies either,
157
152
# so just return them (and don't force the remote_deps promise)
158
153
if (nrow(cran_deps ) == 0 ) {
@@ -163,13 +158,7 @@ combine_remote_deps <- function(cran_deps, remote_deps, remote_precedence) {
163
158
remote_deps <- remote_deps [is.na(remote_deps $ package ) | remote_deps $ package %in% cran_deps $ package , ]
164
159
165
160
# 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 ), ]
173
162
174
163
rbind(remote_deps , cran_deps )
175
164
}
0 commit comments