Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repos ambiguous in lockfile when name includes a comma #587

Open
jmcphers opened this issue Jan 6, 2020 · 0 comments
Open

Repos ambiguous in lockfile when name includes a comma #587

jmcphers opened this issue Jan 6, 2020 · 0 comments

Comments

@jmcphers
Copy link
Member

jmcphers commented Jan 6, 2020

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:

packrat/R/lockfile.R

Lines 35 to 40 in d95fa76

# Construct Repos as a key-value pair to write into the lock file
repos <- activeRepos(dirname(file))
# Windows automatically transforms \n to \r\n on write through write.dcf
separator <- ",\n"
reposString <- paste(names(repos), unname(repos), sep = "=", collapse = separator)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant