rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

Repos ambiguous in lockfile when name includes a comma #587

Open jmcphers opened 4 years ago

jmcphers commented 4 years ago

Repro

Set the following repos option:

options(repos = c(
  `CRAN` = "https://cran.rstudio.com/",
  `Oregon State University` = "https://ftp.osuosl.org/pub/cran/",
  `University of California, Berkeley` = "https://cran.cnr.berkeley.edu/"
))

Then, take a snapshot and look at the lockfile.

Observe

The repos in the lockfile are ambiguous, because they are separated with commas.

Repos: CRAN=https://cran.rstudio.com/, Oregon State
    University=https://ftp.osuosl.org/pub/cran/, University of
    California, Berkeley=https://cran.cnr.berkeley.edu/

In other words, this parses to:

CRAN=https://cran.rstudio.com/
Oregon State University=https://ftp.osuosl.org/pub/cran/
University of California
Berkeley=https://cran.cnr.berkeley.edu/

Details

Appears to be happening here:

https://github.com/rstudio/packrat/blob/d95fa761b7ef5d0db8c92c4befdb2fc48d330501/R/lockfile.R#L35-L40

We probably need to escape commas or choose a different delimiter.