Skip to content

Commit

Permalink
Allow *=?param parameter specifications
Browse files Browse the repository at this point in the history
That apply to all packages.
  • Loading branch information
gaborcsardi committed Feb 7, 2024
1 parent 46bf395 commit fcdfa2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/parse-remotes.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ parse_pkg_ref <- function(ref, remote_types = NULL, ...) {

param_rx <- function() {
paste0(
"(?:(?<package>", package_name_rx(), ")=)",
"(?:(?<package>", package_name_rx(), "|[*])=)",
"$"
)
}
Expand Down
4 changes: 2 additions & 2 deletions R/resolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ res_push <- function(self, private, ..., direct, .list = .list) {
params <- new[new_types == "param"]
new <- new[new_types != "param"]

if (length(params)) {
if (length(params) + length(private$params)) {
private$params <- c(private$params, params)
update_params(self, private, private$params)
}
Expand Down Expand Up @@ -506,7 +506,7 @@ resolve_remote <- function(remote, direct, config, cache, dependencies,

update_params <- function(self, private, params) {
for (par in params) {
if (par$package == "" && length(self$result$params)) {
if (par$package %in% c("", "*") && length(self$result$params)) {
self$result$params <- lapply(self$result$params, function(p) {
p[names(par$params)] <- par$params
p
Expand Down

0 comments on commit fcdfa2b

Please sign in to comment.