Skip to content

Commit

Permalink
optional check on dependency on R version
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@73884 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Dec 11, 2017
1 parent b76c8fd commit b45b3cb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/manual/R-ints.texi
Original file line number Diff line number Diff line change
Expand Up @@ -4151,6 +4151,12 @@ Default: false (but true for CRAN submission checks).
@item _R_CHECK_PRAGMAS_
Run additional checks on the pragmas in C/C++ source code and headers.
Default: false (but true for CRAN submission checks).

@item _R_CHECK_R_DEPENDS_
Check that any dependence on R is not on a recent patch-level version
such as @code{R (>= 3.3.3)} since blocking installation of a package
will also block its reverse dependencies.
Default: false (but will be activated in future).
@end vtable

CRAN's submission checks use something like
Expand Down
18 changes: 18 additions & 0 deletions src/library/tools/R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,24 @@ setRlibs <-
printLog0(Log, paste(out, collapse = "\n"), "\n")
}

## Dependence on say R >= 3.4.3 when 3.4 is current can
## cause problems with revdeps (and did for 3.2.x).
## We only check recent ones.
if(config_val_to_logical(Sys.getenv("_R_CHECK_R_DEPENDS_", "FALSE"))) {
Rver <-.split_description(db, verbose = TRUE)$Rdepends2
if(length(Rver) && Rver[[1L]]$op == ">=") {
ver <- unclass(Rver[[1L]]$version)[[1L]]
if (length(ver) == 3L && ver[3L] != 0 &&
((ver[1L] > 3L) ||
(ver[1L] == 3L) && (ver[2L] >= 3L) )) {
if(!any) noteLog(Log)
any <- TRUE
printLog0(Log,
sprintf("Dependence on R version %s not with patchlevel 0\n",
sQuote(format(Rver[[1L]]$version))))
}
}
}
if (!any) resultLog(Log, "OK")
}

Expand Down

0 comments on commit b45b3cb

Please sign in to comment.