Edzer Pebesma
2012-Jan-18 08:28 UTC
[Rd] how to check all CRAN dependencies for my package, before submitting
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)? -- Edzer Pebesma Institute for Geoinformatics (ifgi), University of M?nster Weseler Stra?e 253, 48151 M?nster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebesma at wwu.de
Uwe Ligges
2012-Jan-18 09:33 UTC
[Rd] how to check all CRAN dependencies for my package, before submitting
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