r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
646 stars 57 forks source link

When installing from CRAN, record repository URL and name #483

Open hadley opened 1 year ago

hadley commented 1 year ago

e.g. something like this:

options(repos = c("FOO" = "https://cran.rstudio.com"))
install.packages("ggplot2")

packageDescription("ggplot2")
#> ...
#> RepositoryUrl: https://cran.rstudio.com
#> RepositoryName: FOO
#> ...
gaborcsardi commented 1 year ago

All extra fields start with Remote currently. The repo URL is already in RemoteRepos. Can we add the repo name in RemoteReposName or something similar?

hadley commented 1 year ago

Yeah RemoteReposName sounds good to me.

gaborcsardi commented 1 year ago

Btw. option("repos") does not need to have names:

❯ dim(available.packages(repos = c("https://cloud.r-project.org", "https://bioconductor.org/packages/3.17/bioc")))
[1] 21572    17

I guess we can add some default names in this case.

hadley commented 1 year ago

Yeah, store the name if present, otherwise don't worry about it.

hadley commented 1 year ago

The point of this feature is to eventually allow people to use "logical" repos, where you might map CRAN to one repo locally and a different repo on your production RSC.