Re: [Rd] how to check all CRAN dependencies for my package, before submitting

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Wed, 18 Jan 2012 10:33:40 +0100

On 18.01.2012 09:28, Edzer Pebesma wrote:
> Suppose I'm author of a package on which quite a few other packages
> depend. When I submit to CRAN, I run R CMD check on it, Kurt does that
> too, and if things work out fine, it is accepted. When one or more of
> the packages that depend on it break because of my changes, however,
> hell breaks loose.
>
> I would like to extend my testing (currently: R CMD check pkg) to
> running R CMD check on all dependent packages, in their most recent
> (CRAN) version. I got stuck trying this.
>
> Does anyone know how to get (i) a list of all packages that depend,
> directly or indirectly, on my package, and (ii) a list of file names of
> their package sources in their latest version (i.e., including their
> latest version number)?

Quick an dirty example:

packages_to_check <- function(dep, which = c("Depends", "Imports", "LinkingTo", "Suggests"), recursive = FALSE){  

download.file("http://cran.R-project.org/web/packages/packages.rds", "packages.rds", mode="wb")

     x <- readRDS("packages.rds")
     x <- x[!duplicated(x[,1]),]
     packages <- x[,1]
     rdeps <- tools:::.package_dependencies(packages = dep, x,
                         which = which,
                         recursive = recursive, reverse = TRUE)
     paste(apply(x[x[,1] %in% rdeps[[1]], 1:2], 1, paste, collapse="_"), 
".tar.gz", sep="")
}

result <- packages_to_check("sp")

or if you want the whole chain including recursive dependencies:

result <- packages_to_check("sp", recursive=TRUE)

Best,
Uwe



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 18 Jan 2012 - 09:35:28 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 Jan 2012 - 22:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive