Skip to content

Commit

Permalink
Update dev version check to use new package dep code
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed May 8, 2015
1 parent aa5bab9 commit 2b432b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions R/check-devtools.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ check_dev_versions <- function(pkg = ".") {
message("Checking for dependencies on development versions... ",
appendLF = FALSE)

deps <- pkg_deps(pkg, NA)
deps <- deps[!is.na(deps$version), , drop = FALSE]
deps <- package_deps(pkg$package, NA)
deps <- deps[!is.na(deps$installed), , drop = FALSE]

parsed <- lapply(deps$version, function(x) unlist(numeric_version(x)))
patch_ver <- vapply(parsed, function(x) x[[length(x)]], integer(1))
parsed <- lapply(deps$installed, function(x) unlist(numeric_version(x)))

is_dev <- patch_ver >= 9000
lengths <- vapply(parsed, length, integer(1))
last_ver <- vapply(parsed, function(x) x[[length(x)]], integer(1))

is_dev <- lengths == 4 && last_ver >= 9000
if (!any(is_dev)) {
message("OK")
return(invisible(TRUE))
Expand Down
1 change: 1 addition & 0 deletions R/release.r
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ release <- function(pkg = ".", check = TRUE) {
return(invisible())

} else {
release_checks(pkg)
if (yesno("Does R CMD check pass with no ERRORs or WARNINGs?"))
return(invisible())

Expand Down

0 comments on commit 2b432b4

Please sign in to comment.