The idea here is to make it extremely easy to keep a drat repository up to date.
Suppose you have a drat that tracks a number of upstream github repos (here the repos are the package repositories and drat repository will be the drat itself). Say, reomoji, rfiglet and cowsay
In the root of an existing drat repository or in a new empty directory, make a file called packages.txt containing:
richfitz/remoji
richfitz/rfiglet
sckott/cowsay
Then run
drat.builder::build()
which will download the most recent sources for those packages, build them (source versions only, but will build vignettes) and add them to drat following the best practice commit log so that each log entry reads like
<package_name> <version> <sha> <url>
e.g.,
rfiglet 0.1.0 4b65d19 https://github.com/richfitz/rfiglet.git
Run
drat.builder::install_script("~/bin")
and then a shell script drat.builder is available. It takes all the arguments that drat.builder::build takes, but is useful to run from the command line. See
drat.builder --help
for help.
drat.builder takes options
install -- installs packages before building so that vignettes can be builtinstall_local -- implies install, and installs locally and temporarily rather than into a system-readable libraryno_fetch -- suppresses fetching packagesThe file packages.txt roughly follows the convention started by devtools;
username/repo/subdir -- install package from a subdirusername/repo@ref -- install a particular referenceusername/repo/subdir@ref -- both a subdir and a referenceThe @ref syntax will be useful to anchor drat builds to particular versions, rather than constantly reading off HEAD of the upstream repo. This will be easy when the upstream repo uses github releases and semantic versioning as you can write:
richfitz/[email protected]
To avoid polluting the drat repo, drat.builder will try to avoid rebuilding. To do this it keeps a file packages.json with version numbers and sha values of the installed packages.
R CMD build)Content type
Image
Digest
Size
360.1 MB
Last updated
over 5 years ago
docker pull richfitz/drat.builder