#! /usr/bin/env Rscript pkgdiff <- function(from, to) { clean <- function(txt) { txt <- grep("^(\\* using R|Time) ", txt, invert = TRUE, value = TRUE, useBytes = TRUE) txt <- grep("using platform", txt, invert = TRUE, value = TRUE, useBytes = TRUE) txt <- grep("^\\* using option", txt, invert = TRUE, value = TRUE, useBytes = TRUE) txt <- grep("^\\* checking (for non-standard things|for detritus|LazyData.*OK|for new files in some other directories ... OK)", txt, invert = TRUE, value = TRUE, useBytes = TRUE) txt <- grep("^\\* (using|used) (C|Fortran)", txt, invert = TRUE, value = TRUE) txt <- grep("^\\* running under:", txt, invert = TRUE, value = TRUE) txt <- grep("^(\\* R was compiled| *gcc| *clang| *GNU Fortran)", txt, invert = TRUE, value = TRUE) txt <- grep("^(\\* R was compiled| *gcc| *clang| *GNU Fortran| *Intel| *ifx)", txt, invert = TRUE, value = TRUE) # txt <- grep("checking startup messages can be suppressed.*OK", txt, # invert = TRUE, value = TRUE) # txt <- grep("checking whether startup messages can be suppressed.*OK", txt, # invert = TRUE, value = TRUE) txt <- grep("Documented arguments not in", txt, invert = TRUE, value = TRUE) txt <- grep('^\\* checking package vignettes ', txt, invert = TRUE, value = TRUE, useBytes = TRUE) txt <- txt[nzchar(txt)] gsub(" \\[[0-9]+[sm]/[0-9]+[sm]\\]", "", txt, useBytes = FALSE) } left <- clean(readLines(from, warn = FALSE)) right <- clean(readLines(to, warn = FALSE)) if(length(left) != length(right) || !all(left == right)) { cat("\n*** ", from, "\n", sep="") writeLines(left, a <- tempfile("Rdiffa")) writeLines(right, b <- tempfile("Rdiffb")) system(paste("diff -bw", shQuote(a), shQuote(b))) } } l1 <- Sys.glob("*.out") l2 <- Sys.glob("../tests-devel-keep/*.out") l3 <- basename(l2) options(stringsAsFactors = FALSE) m <- merge(data.frame(x=l1), data.frame(x=l3, y=l2))[,1] mm <- lapply(m, function(x) pkgdiff(x, file.path("../tests-devel-keep", x)))