Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Repository:" field in R DESCRIPTION files

Question: What is the purpose and origin of the Repository: field in a package DESCRIPTION file?

It doesn't seem to be mentioned in the official docs for DESCRIPTION files, nor in Hadley's book. It seems to be auto-populated during CRAN upload - e.g. it's not in dplyr's original DESCRIPTION source, but it's present in the CRAN tarball DESCRIPTION:

...
Maintainer: Hadley Wickham <[email protected]>
Repository: CRAN
Date/Publication: 2019-05-14 12:20:03 UTC

Background: I ask because packrat seems to use the presence/absence of this field to determine whether a package can be found in a repository somewhere - if not, it requires you to download it manually. This is a problem for locally-developed packages that are hosted in a local CRAN-like repository.

We can start adding the Repository: field to our local packages, but that's kind of a pain to do with all the previous versions, it will mess up their tarball checksum, etc. And I wouldn't want to do it without understanding what it's for.

like image 909
Ken Williams Avatar asked May 23 '19 14:05

Ken Williams


1 Answers

It seems to be a field added silently by both CRAN and Bioconductor, and taken advantage of by packrat. I contributed a Pull Request (now merged) to allow the field to be missing: https://github.com/rstudio/packrat/pull/569. The GitHub issue has now been resolved: https://github.com/rstudio/packrat/issues/528.

like image 183
Ken Williams Avatar answered Oct 22 '22 07:10

Ken Williams