Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

yet another bugfix for maintainer()

git-svn-id: https://svn.r-project.org/R/trunk@60906 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
commit 601e71efc3cf34573b78fc096e0272f641bc455f 1 parent eda9c0e
ripley authored
4 doc/NEWS.Rd
View
@@ -621,7 +621,9 @@
\item The HTML manuals now use directional single quotes.
- \item \code{maintainer()} now converts embedded new lines to spaces.
+ \item \code{maintainer()} now converts embedded new lines to
+ spaces. It no longer gives a non-obvious error for non-installed
+ packages.
\item The \code{X11()} device has some protection against
being used with forked processes \emph{via} package \pkg{parallel}.
7 src/library/utils/R/indices.R
View
@@ -133,9 +133,12 @@ print.packageDescription <-
# Simple convenience functions
-maintainer <- function(pkg) {
+maintainer <- function(pkg)
+{
force(pkg)
- gsub("\n", " ",packageDescription(pkg)$Maintainer, fixed = TRUE)
+ desc <- packageDescription(pkg)
+ if(is.list(desc)) gsub("\n", " ", desc$Maintainer, fixed = TRUE)
+ else NA_character_
}
packageVersion <- function(pkg, lib.loc = NULL)
11 src/library/utils/man/maintainer.Rd
View
@@ -1,6 +1,6 @@
% File src/library/utils/man/maintainer.Rd
% Part of the R package, http://www.R-project.org
-% Copyright 1995-2011 R Core Team
+% Copyright 1995-2012 R Core Team
% Distributed under GPL 2 or later
\name{maintainer}
@@ -16,9 +16,7 @@
maintainer(pkg)
}
\arguments{
- \item{pkg}{
- Character. The name of a single package.
-}
+ \item{pkg}{Character string. The name of a single package.}
}
\details{
Accesses the package description to return the name and email address of
@@ -32,12 +30,13 @@ maintainer(pkg)
}
\value{
A character string giving the name and email address of the maintainer
- of the package.
+ of the package, or \code{NA} if no such package is installed.
}
\author{
David Scott <d.scott@auckland.ac.nz> from code on R-help originally
- due to Charlie Sharpsteen <source@sharpsteen.net>.
+ due to Charlie Sharpsteen <source@sharpsteen.net>; multiple corrections
+ by R-core.
}
\references{
\url{https://stat.ethz.ch/pipermail/r-help/2010-February/230027.html}
6 tests/reg-tests-1b.R
View
@@ -1993,4 +1993,10 @@ stopifnot(inherits(try(arima.sim(list(order = c(1,0,0), ar = 0.7), n = 0)),
## one too long in R < 2.15.2
+## maintainer()
+maintainer('stats')
+maintainer("impossible_package_name")
+## gave an error in R < 2.15.2
+
+
proc.time()
Please sign in to comment.
Something went wrong with that request. Please try again.