Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #216 from wch/no-vignette

build: if pdflatex not present, don't build vignettes. Fixes #173
  • Loading branch information...
commit 98d1ca66f8944dd6cdd3f1d4388da8254b4c96a0 2 parents bd5f803 + 2fd8749
@wch wch authored
Showing with 19 additions and 3 deletions.
  1. +3 −0  NEWS
  2. +10 −3 R/build.r
  3. +6 −0 R/check.r
View
3  NEWS
@@ -32,6 +32,9 @@ MINOR FEATURES
* New function `install_git()` installs a package directly from a git
repository. (Thanks to David Coallier)
+* If `pdflatex` isn't available, don't try to build vignettes with `install()`
+ or `check()`. (Fixes #173)
+
BUG FIXES
* Fixed path issue when looking for Rtools on windows when registry entry is not present. (Fixes #201)
View
13 R/build.r
@@ -5,7 +5,7 @@
#' @param path path in which to produce package. If \code{NULL}, defaults to
#' the parent directory of the package.
#' @param binary Produce a binary (\code{--binary}) or source (
-#' \code{--no-manual --no-vignettes}) version of the package.
+#' \code{--no-manual --no-resave-data}) version of the package.
#' @export
#' @family build functions
#' @return a string giving the location (including file name) of the built
@@ -22,8 +22,15 @@ build <- function(pkg = ".", path = NULL, binary = FALSE) {
cmd <- paste("CMD INSTALL ", shQuote(pkg$path), " --build", sep = "")
ext <- if (.Platform$OS.type == "windows") "zip" else "tgz"
} else {
- cmd <- paste("CMD build ", shQuote(pkg$path),
- " --no-manual --no-resave-data", sep = "")
+ args <- " --no-manual --no-resave-data"
+
+ if (!nzchar(Sys.which("pdflatex"))) {
+ message("pdflatex not found. Not building PDF vignettes.")
+ args <- paste(args, "--no-vignettes")
+ }
+
+ cmd <- paste("CMD build ", shQuote(pkg$path), args, sep = "")
+
ext <- "tar.gz"
}
R(cmd, path)
View
6 R/check.r
@@ -63,6 +63,12 @@ check_r_cmd <- function(built_path = NULL, cran = TRUE, check_version = FALSE,
pkgname <- gsub("_.*?$", "", basename(built_path))
opts <- "--timings"
+ if (!nzchar(Sys.which("pdflatex"))) {
+ message("pdflatex not found! Not building PDF vignettes.\n",
+ "If you are planning to release this package, please run a check with vignettes beforehand.\n")
+ opts <- c(opts, "--no-rebuild-vignettes")
+ }
+
opts <- paste(paste(opts, collapse = " "), paste(args, collapse = " "))
env_vars <- NULL
Please sign in to comment.
Something went wrong with that request. Please try again.