r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

available_packages has no option to set `headers` #682

Open AshesITR opened 2 years ago

AshesITR commented 2 years ago

We use a private CRAN repository which requires http authorization headers to query and install packages. While remotes::install_deps() has a headers argument, it is not passed to remotes::available_packages(), preventing correct operation.

A clumsy work around is manually setting the cache beforehand via

ap <- utils::available.packages(type = "source", headers = my_secret_auth)
remotes::available_packages_set(
  repos = getOption("repos"),
  type = "source",
  db = ap
)
remotes::install_deps(
  dependencies = TRUE,
  type = "source",
  headers = my_secret_auth
)

It would be nice if remotes::install_deps() passed the headers option to remotes::available_packages() so this work-around is no longer necessary.