rstudio / rstudio/packrat

Repos ambiguous in lockfile when name includes a comma

Open
#587 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect R/lockfile.R at the referenced lines where repositories are serialized in the lockfile. Reproduce the snapshot using a repository name containing a comma, then adjust the representation so repository names and URLs remain unambiguous. Done means the resulting lockfile can distinguish all three repositories without misparsing their names.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.