Skip to content

Commit

Permalink
fix for custom headers in available.packages (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Oct 9, 2024
1 parent 41716e7 commit 5725cde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# renv (development version)

* Fixed an issue where headers were not properly passed to `available.packages()`
during `renv` bootstrap. (#1942)

* `renv` now assumes that Artifactory package repositories will use a CRAN-like
layout of packages for packages in the archive. (#1996)

Expand Down
8 changes: 3 additions & 5 deletions R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ renv_bootstrap_download_impl <- function(url, destfile) {
quiet = TRUE
)

if ("headers" %in% names(formals(utils::download.file)))
{
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
Expand Down Expand Up @@ -298,9 +297,8 @@ renv_bootstrap_download_cran_latest_find <- function(version) {

# add custom headers if available -- note that
# utils::available.packages() will pass this to download.file()
if ("headers" %in% names(formals(utils::download.file)))
{
headers <- renv_bootstrap_download_custom_headers(url)
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(repos)
if (length(headers) && is.character(headers))
args$headers <- headers
}
Expand Down
8 changes: 3 additions & 5 deletions inst/resources/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ local({
quiet = TRUE
)

if ("headers" %in% names(formals(utils::download.file)))
{
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
Expand Down Expand Up @@ -457,9 +456,8 @@ local({

# add custom headers if available -- note that
# utils::available.packages() will pass this to download.file()
if ("headers" %in% names(formals(utils::download.file)))
{
headers <- renv_bootstrap_download_custom_headers(url)
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(repos)
if (length(headers) && is.character(headers))
args$headers <- headers
}
Expand Down

0 comments on commit 5725cde

Please sign in to comment.