From Mark.Bravington at csiro.au  Tue Mar 10 11:52:30 2009
From: Mark.Bravington at csiro.au (Mark.Bravington at csiro.au)
Date: Tue, 10 Mar 2009 21:52:30 +1100
Subject: [Rd] suggestion/request: install.packages and unnecessary file
 modifications
Message-ID: <62C82B39B8A85E4B95A18F7F7B852F87051705E427@exvic-mbx03.nexus.csiro.au>

Dear R-devel

When 'install.packages' runs, it updates all html files in all packages. Mostly, there seems to be no actual change to the html file contents, but the date/time does change. This has causing been me a bit of trouble, because I keep synchronized versions of R on several different machines, and whenever I install a package, many MB of file transfers are required; my slow upload link can't cope.

The culprit appears to be 'utils:::fixup.package.URLs'. Adding the commented lines below, near the end of the function, avoids the unnecessary rewrite.

Mark Bravington
CSIRO
Hobart
Australia

    for (f in files) {
        page <- readLines(f)
        old.page <- page # MVB
        page <- gsub(olddoc, doc, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(oldbase, base, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(oldutils, utils, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(oldgraphics, graphics, page, fixed = TRUE, 
            useBytes = TRUE)
        page <- gsub(oldstats, stats, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(olddata, datasets, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(oldgrD, grD, page, fixed = TRUE, useBytes = TRUE)
        page <- gsub(oldmeth, meth, page, fixed = TRUE, useBytes = TRUE)
        if( identical( page, old.page)) # MVB
    next # MVB
        out <- try(file(f, open = "w"), silent = TRUE)
        if (inherits(out, "try-error")) {
            warning(gettextf("cannot update '%s'", f), domain = NA)
            next
        }
        writeLines(page, out)
        close(out)
    }
    return(TRUE)
}



[Rd] suggestion/request: install.packages and unnecessary file modifications
Mark.Bravington at csiro.au