Skip to content

Commit d91ba03

Browse files
author
ripley
committed
allow for malformed tarballs (like those in tests)
git-svn-id: https://svn.r-project.org/R/trunk@88346 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 3506dce commit d91ba03

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/library/tools/R/check.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7563,12 +7563,14 @@ add_dummies <- function(dir, Log)
75637563
domain = NA, call. = FALSE, immediate. = TRUE)
75647564
next
75657565
}
7566-
if (length(contents) < 1 || !endsWith(contents[1], "/")) {
7566+
if (length(contents) < 1L) {
75677567
warning(sQuote(pkg), " does not contain a directory, skipping\n",
75687568
domain = NA, call. = FALSE, immediate. = TRUE)
75697569
next
7570+
} else {
7571+
## some people omit the directory itself from the tarball
7572+
pkgname0 <- sub("/.*", "", contents[1L])
75707573
}
7571-
pkgname0 <- sub("/$", "", contents[1])
75727574
} else {
75737575
warning(sQuote(pkg), " is neither a file nor directory, skipping\n",
75747576
domain = NA, call. = FALSE, immediate. = TRUE)

0 commit comments

Comments
 (0)