diff --git a/DESCRIPTION b/DESCRIPTION index 14a8a95f..396a3902 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,4 +22,4 @@ Suggests: Enhances: BiocInstaller URL: https://github.com/rstudio/packrat/ BugReports: https://github.com/rstudio/packrat/issues -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 diff --git a/R/aaa-globals.R b/R/aaa-globals.R index ce7fc884..324e8ecc 100644 --- a/R/aaa-globals.R +++ b/R/aaa-globals.R @@ -37,5 +37,6 @@ new_defaults = function(value = list()) { ## These should be set on entering, exiting packrat mode .packrat_mutables <- new_defaults(list( origLibPaths = NULL, - project = NULL + project = NULL, + snapshot.recursive.dependency = FALSE )) diff --git a/R/hooks.R b/R/hooks.R index b52fafb9..d92dd17e 100644 --- a/R/hooks.R +++ b/R/hooks.R @@ -75,7 +75,8 @@ buildSnapshotHookCall <- function(project, debug = FALSE) { snapshotArgs <- paste(sep = ", ", peq("project", surround(project, with = "'")), peq("auto.snapshot", "TRUE"), - peq("verbose", "FALSE") + peq("verbose", "FALSE"), + peq("snapshot.recursive.dependency", get_opts("snapshot.recursive.dependency")) ) repos <- gsub("\"", "'", paste(deparse(getOption('repos'), width.cutoff = 500), collapse = ' ')) diff --git a/R/options.R b/R/options.R index 3fa34144..19636ae1 100644 --- a/R/options.R +++ b/R/options.R @@ -22,7 +22,8 @@ VALID_OPTIONS <- list( snapshot.recommended.packages = list(TRUE, FALSE), snapshot.fields = function(x) { is.null(x) || is.character(x) - } + }, + snapshot.recursive.dependency = list(TRUE, FALSE) ) default_opts <- function() { @@ -38,7 +39,8 @@ default_opts <- function() { ignored.packages = NULL, quiet.package.installation = TRUE, snapshot.recommended.packages = FALSE, - snapshot.fields = c("Imports", "Depends", "LinkingTo") + snapshot.fields = c("Imports", "Depends", "LinkingTo"), + snapshot.recursive.dependency = FALSE ) } @@ -105,6 +107,8 @@ initOptions <- function(project = NULL, options = default_opts()) { ##' What fields of a package's DESCRIPTION file should be used when discovering ##' dependencies? ##' (character, defaults to \code{c("Imports", "Depends", "LinkingTo")}) +##' \item \code{snapshot.recursive.dependency}: +##' Make a recursive dependency search when doing a snapshot ##' } ##' ##' @param options A character vector of valid option names. diff --git a/R/snapshot.R b/R/snapshot.R index 5aab4383..1aa0930d 100644 --- a/R/snapshot.R +++ b/R/snapshot.R @@ -102,6 +102,8 @@ snapshot <- function(project = NULL, #' dependency of this project, if not otherwise discovered? This should be #' \code{FALSE} only if you can guarantee that \code{packrat} will be available #' via other means when attempting to load this project. +#' @param snapshot.recursive.dependency Perform a recursive dependency search, +#' to complete the "Require" field in the packrat.lock file #' @keywords internal #' @rdname snapshotImpl #' @export @@ -115,7 +117,8 @@ snapshot <- function(project = NULL, verbose = TRUE, fallback.ok = FALSE, snapshot.sources = TRUE, - implicit.packrat.dependency = TRUE) { + implicit.packrat.dependency = TRUE, + snapshot.recursive.dependency = get_opts("snapshot.recursive.dependency")) { if (is.null(available)) { @@ -169,7 +172,7 @@ snapshot <- function(project = NULL, project = project, available = available, lib.loc = lib.loc, - recursive = FALSE) + recursive = snapshot.recursive.dependency) # For inferred packages (ie. packages within the code), we try to construct # records first from the lockfile, and then from other sources if possible diff --git a/man/appDependencies.Rd b/man/appDependencies.Rd index 3f01180a..619fed40 100644 --- a/man/appDependencies.Rd +++ b/man/appDependencies.Rd @@ -46,4 +46,3 @@ appDependencies("~/projects/shiny/app1") } } \keyword{internal} - diff --git a/man/bundle.Rd b/man/bundle.Rd index 75069c6f..f962ca08 100644 --- a/man/bundle.Rd +++ b/man/bundle.Rd @@ -47,4 +47,3 @@ be unbundled either with \code{packrat::\link{unbundle}} (which restores the project as well), \R's own \code{utils::\link{untar}}, or through most system \code{tar} implementations. } - diff --git a/man/clean.Rd b/man/clean.Rd index 36cf6e02..2bc436a4 100644 --- a/man/clean.Rd +++ b/man/clean.Rd @@ -40,4 +40,3 @@ clean("foo") } } - diff --git a/man/disable.Rd b/man/disable.Rd index c4a7606c..2769aa1c 100644 --- a/man/disable.Rd +++ b/man/disable.Rd @@ -29,4 +29,3 @@ The \code{restart} parameter will only result in a restart of R when the R environment packrat is running within makes available a restart function via \code{getOption("restart")}. } - diff --git a/man/init.Rd b/man/init.Rd index 9be5d5c1..6b06a9ab 100644 --- a/man/init.Rd +++ b/man/init.Rd @@ -65,4 +65,3 @@ packrat::init(options = list(local.repos = "~/projects/R")) \link{packrat} for a description of the files created by \code{init}. } - diff --git a/man/install.Rd b/man/install.Rd index 79af76c0..dc7cf5a6 100644 --- a/man/install.Rd +++ b/man/install.Rd @@ -57,4 +57,3 @@ directory pristine. If the package is loaded, it will be reloaded after installation. } - diff --git a/man/install_local.Rd b/man/install_local.Rd index b20586f9..47b2423a 100644 --- a/man/install_local.Rd +++ b/man/install_local.Rd @@ -20,4 +20,3 @@ install_local(pkgs, ..., lib = .libPaths()[1], This function can be used to install a package from a local 'repository'; i.e., a directory containing package tarballs and sources. } - diff --git a/man/migrate.Rd b/man/migrate.Rd index a364ed56..9d60336b 100644 --- a/man/migrate.Rd +++ b/man/migrate.Rd @@ -26,4 +26,3 @@ This function will: \item Update the package \code{.Rprofile}. } } - diff --git a/man/packify.Rd b/man/packify.Rd index 4da6ca33..a515ba80 100644 --- a/man/packify.Rd +++ b/man/packify.Rd @@ -25,4 +25,3 @@ source control, or were accidentally removed). You'll need to restart \R in the specified directory after running \code{packify} in order to start using the private package library. } - diff --git a/man/packrat-external.Rd b/man/packrat-external.Rd index b3a42b32..85c2f571 100644 --- a/man/packrat-external.Rd +++ b/man/packrat-external.Rd @@ -1,11 +1,14 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/external.R, R/paths.R \name{packrat-external} +\alias{packrat-external} +\alias{with_extlib} +\alias{packrat-external} \alias{extlib} \alias{packrat-external} -\alias{packrat_lib} \alias{user_lib} -\alias{with_extlib} +\alias{packrat-external} +\alias{packrat_lib} \title{Managing External Libraries} \usage{ with_extlib(packages, expr, envir = parent.frame()) @@ -35,4 +38,3 @@ libraries; that is, the libraries that would be available upon launching a new with_extlib("lattice", xyplot(1 ~ 1)) } } - diff --git a/man/packrat-mode.Rd b/man/packrat-mode.Rd index bcc2e3ae..df01427e 100644 --- a/man/packrat-mode.Rd +++ b/man/packrat-mode.Rd @@ -1,10 +1,12 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/packrat-mode.R \name{packrat-mode} -\alias{off} -\alias{on} \alias{packrat-mode} \alias{packrat_mode} +\alias{packrat-mode} +\alias{on} +\alias{packrat-mode} +\alias{off} \title{Packrat Mode} \usage{ packrat_mode(on = NULL, project = NULL, @@ -36,4 +38,3 @@ Use these functions to switch \code{packrat} mode on and off. When within \code{packrat} mode, the \R session will use the private library generated for the current project. } - diff --git a/man/packrat-options.Rd b/man/packrat-options.Rd index d8410057..09887df9 100644 --- a/man/packrat-options.Rd +++ b/man/packrat-options.Rd @@ -2,10 +2,11 @@ % Please edit documentation in R/options.R \docType{data} \name{packrat-options} +\alias{packrat-options} \alias{get_opts} -\alias{opts} \alias{packrat-options} \alias{set_opts} +\alias{opts} \title{Get/set packrat project options} \usage{ get_opts(options = NULL, simplify = TRUE, project = NULL) @@ -84,8 +85,11 @@ Get and set options for the current packrat-managed project. What fields of a package's DESCRIPTION file should be used when discovering dependencies? (character, defaults to \code{c("Imports", "Depends", "LinkingTo")}) +\item \code{snapshot.recursive.dependency}: + Make a recursive dependency search when doing a snapshot } } + \examples{ \dontrun{ ## use 'devtools' and 'knitr' from the user library @@ -102,4 +106,3 @@ packrat::opts$external.packages(c("devtools", "knitr")) } } \keyword{datasets} - diff --git a/man/packrat-resources.Rd b/man/packrat-resources.Rd index d2969923..9b193389 100644 --- a/man/packrat-resources.Rd +++ b/man/packrat-resources.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/paths.R \name{packrat-resources} -\alias{bundles_dir} -\alias{lib_dir} \alias{packrat-resources} \alias{project_dir} \alias{src_dir} +\alias{lib_dir} +\alias{bundles_dir} \title{Paths to Packrat Resources} \usage{ project_dir(project = NULL) diff --git a/man/packrat.Rd b/man/packrat.Rd index 5979e059..144c4677 100644 --- a/man/packrat.Rd +++ b/man/packrat.Rd @@ -63,6 +63,7 @@ version control system. Be sure to check in the \code{.Rprofile}, feel free to check it in if you don't mind taking up some extra space in your repository). } + \examples{ \dontrun{ # Create a new packrat project from an existing directory of \\R code @@ -81,4 +82,3 @@ restore() \author{ RStudio, Inc. } - diff --git a/man/repos_create.Rd b/man/repos_create.Rd index 801c8882..916c1533 100644 --- a/man/repos_create.Rd +++ b/man/repos_create.Rd @@ -18,4 +18,3 @@ directory name in which the reopsitory is created.} Generate a local CRAN-like repository which can be used to store and distribute \R packages. } - diff --git a/man/repos_upload.Rd b/man/repos_upload.Rd index 9a425faf..997079f0 100644 --- a/man/repos_upload.Rd +++ b/man/repos_upload.Rd @@ -21,4 +21,3 @@ be a local (on-disk) CRAN repository.} \description{ Upload a Package to a Local CRAN-like Repository } - diff --git a/man/repository-management.Rd b/man/repository-management.Rd index b53f39b6..e96102c4 100644 --- a/man/repository-management.Rd +++ b/man/repository-management.Rd @@ -1,13 +1,18 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/cranlike-repositories.R \name{repository-management} +\alias{repository-management} \alias{repos_add} +\alias{repository-management} \alias{repos_add_local} -\alias{repos_list} -\alias{repos_remove} +\alias{repository-management} \alias{repos_set} +\alias{repository-management} \alias{repos_set_local} \alias{repository-management} +\alias{repos_remove} +\alias{repository-management} +\alias{repos_list} \title{Add a Repository} \usage{ repos_add(..., overwrite = FALSE) @@ -40,4 +45,3 @@ effectively an easier-to-use wrapper over interacting with the \code{repos_add_local} is used for adding file-based repositories; that is, CRAN repositories that live locally on disk and not on the internet / local network. } - diff --git a/man/restore.Rd b/man/restore.Rd index 38aca39c..f8cf7be8 100644 --- a/man/restore.Rd +++ b/man/restore.Rd @@ -75,4 +75,3 @@ via \code{getOption("restart")}. \code{\link{status}} to view the differences between the most recent snapshot and the library. } - diff --git a/man/search_path.Rd b/man/search_path.Rd index 352d51b3..e9029b9b 100644 --- a/man/search_path.Rd +++ b/man/search_path.Rd @@ -10,4 +10,3 @@ search_path() Retrieve the packages on the search path, as well as the associated library location. } - diff --git a/man/snapshot.Rd b/man/snapshot.Rd index b932104a..f027e26b 100644 --- a/man/snapshot.Rd +++ b/man/snapshot.Rd @@ -60,4 +60,3 @@ snapshot(dry.run = TRUE) \code{\link{status}} to view the differences between the most recent snapshot and the library. } - diff --git a/man/snapshotImpl.Rd b/man/snapshotImpl.Rd index 802b3cbd..5064efb0 100644 --- a/man/snapshotImpl.Rd +++ b/man/snapshotImpl.Rd @@ -7,7 +7,8 @@ .snapshotImpl(project, available = NULL, lib.loc = libDir(project), dry.run = FALSE, ignore.stale = FALSE, prompt = interactive(), auto.snapshot = FALSE, verbose = TRUE, fallback.ok = FALSE, - snapshot.sources = TRUE, implicit.packrat.dependency = TRUE) + snapshot.sources = TRUE, implicit.packrat.dependency = TRUE, + snapshot.recursive.dependency = get_opts("snapshot.recursive.dependency")) } \arguments{ \item{project}{The project directory. Defaults to current working @@ -51,10 +52,11 @@ package?} dependency of this project, if not otherwise discovered? This should be \code{FALSE} only if you can guarantee that \code{packrat} will be available via other means when attempting to load this project.} + +\item{snapshot.recursive.dependency}{Perform a recursive dependency search} } \description{ This is the internal implementation for \code{\link{snapshot}}. Most users should prefer calling \code{\link{snapshot}}. } \keyword{internal} - diff --git a/man/status.Rd b/man/status.Rd index ee633fc8..84cb7ae8 100644 --- a/man/status.Rd +++ b/man/status.Rd @@ -37,4 +37,3 @@ Differences can also arise if one of your collaborators adds or removes packages from the packrat dependencies. In this case, you simply need to tell packrat to update your private package library using \code{\link{restore}}. } - diff --git a/man/unbundle.Rd b/man/unbundle.Rd index b6bfce44..95ac5ca4 100644 --- a/man/unbundle.Rd +++ b/man/unbundle.Rd @@ -19,4 +19,3 @@ after \code{unbundle}-ing the project?} \description{ Unbundle a previously \code{\link{bundle}}d project. } - diff --git a/man/unused_packages.Rd b/man/unused_packages.Rd index 9c866fa3..22769664 100644 --- a/man/unused_packages.Rd +++ b/man/unused_packages.Rd @@ -15,4 +15,3 @@ unused_packages(project = NULL, lib.loc = libDir(project)) Unused packages are those still contained within your project library, but are unused in your project. } -