Permalink
Browse files

add check for detritus

git-svn-id: https://svn.r-project.org/R/trunk@60880 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent d032cc9 commit 6035b91e4a1d4691548cd26f53f6f9bc3b04429d ripley committed Oct 6, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/library/tools/R/check.R
@@ -260,6 +260,7 @@ setRlibs <- function(lib0 = "", pkgdir = ".", suggests = FALSE,
if (R_check_permissions) check_permissions(allfiles)
check_meta() # Check DESCRIPTION meta-information.
check_top_level()
+ check_detritus()
check_indices()
check_subdirectories(haveR, subdirs)
## Check R code for non-ASCII chars which
@@ -594,6 +595,23 @@ setRlibs <- function(lib0 = "", pkgdir = ".", suggests = FALSE,
} else resultLog(Log, "OK")
}
+ check_detritus <- function()
+ {
+ checkingLog(Log, "left-over files")
+ files <- dir(".", full.names = TRUE, recursive = TRUE)
+ bad <- grep("svn-commit[.].*tmp$", files, value = TRUE)
+ if (length(bad)) {
+ bad <- sub("^[.]/", "", bad)
+ noteLog(Log)
+ printLog(Log,
+ "The following files look like leftovers:\n",
+ paste(strwrap(paste(sQuote(bad), collapse = ", "),
+ indent = 2, exdent = 2), collapse = "\n"),
+ "\nPlease remove them from your package.\n")
+ } else resultLog(Log, "OK")
+ }
+
+
check_indices <- function()
{
## Check index information.

0 comments on commit 6035b91

Please sign in to comment.