Skip to content

Commit

Permalink
handle repositories without binary arms (closes #1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Jul 18, 2022
1 parent ccc67d7 commit a0f34e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: renv
Type: Package
Title: Project Environments
Version: 0.15.5-39
Version: 0.15.5-40
Authors@R: c(
person("Kevin", "Ushey", role = c("aut", "cre"), email = "kevin@rstudio.com"),
person("RStudio, PBC", role = c("cph"))
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

# renv 0.16.0 (UNRELEASED)

* Fixed an issue where package installation could fail when the R session
is configured to use multiple repositories, some of which do not provide
any information on available packages for certain binary arms of the
repository. (#1045)

* `renv` now uses `jsonlite` for reading lockfiles when loaded. This should
help ensure useful errors are provided for manually-edited lockfiles
which contain a JSON parsing error. If the `jsonlite` package is not loaded,
Expand Down
9 changes: 8 additions & 1 deletion R/available-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,15 @@ renv_available_packages_latest_repos_impl <- function(package, type, repos) {
version <- numeric_version(entries$Version)
ordered <- order(version, decreasing = TRUE)

# return newest-available version
# extract newest entry
entry <- as.list(entries[ordered[[1L]], ])

# remove an NA file entry if necessary
# https://github.com/rstudio/renv/issues/1045
if (length(entry$File) && is.na(entry$File))
entry$File <- NULL

# return newest-available version
renv_available_packages_record(entry, type)

}
Expand Down

0 comments on commit a0f34e3

Please sign in to comment.