Skip to content

Commit e447769

Browse files
author
ripley
committed
make tarball naming for R CMD check less restrictive
git-svn-id: https://svn.r-project.org/R/trunk@88343 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 8694ed5 commit e447769

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

doc/NEWS.Rd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@
107107

108108
Where \R is used via extensive \abbr{IDE}s such as \command{RStudio},
109109
their maintainers may need to adapt \file{R.css} files accordingly.
110+
111+
\command{R CMD check} when passed a tarballl looks at its contents
112+
and so no longer derives the package name from the tarball name
113+
(which can now be arbitrary).
110114
}
111115
}
112116

@@ -162,7 +166,7 @@
162166
\subsection{UTILITIES}{
163167
\itemize{
164168
\item \command{R CMD check} now handles archives with extension
165-
\file{.tar} and \file{.tar.zstd} (where \command{zstd} compression
169+
\file{.tar} or \file{.tar.zstd} (where \command{zstd} compression
166170
is supported by the \R build).
167171
}
168172
}

src/library/tools/R/check.R

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7551,9 +7551,24 @@ add_dummies <- function(dir, Log)
75517551
if (thispkg_subdirs == "default") thispkg_subdirs <- "no"
75527552
} else if (file.exists(pkg)) {
75537553
is_tar <- TRUE
7554-
if (thispkg_subdirs == "default") thispkg_subdirs <- "yes-maybe"
7555-
pkgname0 <- sub("\\.(tar|tar\\.gz|tgz|tar\\.bz2|tar\\.xz|tar\\.zstd)$", "", pkgname0)
7556-
pkgname0 <- sub("_[0-9.-]*$", "", pkgname0)
7554+
## if (thispkg_subdirs == "default") thispkg_subdirs <- "yes-maybe"
7555+
## pkgname0 <- sub("\\.(tar|tar\\.gz|tgz|tar\\.bz2|tar\\.xz|tar\\.zstd)$", "", pkgname0)
7556+
## pkgname0 <- sub("_[0-9.-]*$", "", pkgname0)
7557+
## look at the contents to find the package name
7558+
contents <- try(
7559+
utils::untar(pkg, list = TRUE,
7560+
tar = Sys.getenv("R_INSTALL_TAR", "internal")))
7561+
if(inherits(contents, "try-error")) {
7562+
warning(sQuote(pkg), " is neither a tarball nor a directory, skipping\n",
7563+
domain = NA, call. = FALSE, immediate. = TRUE)
7564+
next
7565+
}
7566+
if (length(contents) < 1 || !endsWith(contents[1], "/")) {
7567+
warning(sQuote(pkg), " does not contain a directory, skipping\n",
7568+
domain = NA, call. = FALSE, immediate. = TRUE)
7569+
next
7570+
}
7571+
pkgname0 <- sub("/$", "", contents[1])
75577572
} else {
75587573
warning(sQuote(pkg), " is neither a file nor directory, skipping\n",
75597574
domain = NA, call. = FALSE, immediate. = TRUE)

src/library/utils/man/PkgUtils.Rd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
}
1818
\arguments{
1919
\item{pkgdirs}{a list of names of directories with sources of \R
20-
add-on packages. For \code{check} these can also be the filenames of
21-
(possibly compressed) \command{tar} archives with extension
22-
\file{.tar}, \file{.tar.gz}, \file{.tgz}, \file{.tar.bz2},
23-
\file{.tar.xz} or \file{.tar.zstd}.}
20+
add-on packages. For \code{check} these can also be the filepaths of
21+
(possibly compressed) \command{tar} archives.}
2422
\item{options}{further options to control the processing, or for
2523
obtaining information about usage and version of the utility.}
2624
}

0 commit comments

Comments
 (0)