Mark.Bravington at csiro.au
2009-Mar-10 10:52 UTC
[Rd] suggestion/request: install.packages and unnecessary file modifications
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) }
Martin Maechler
2009-Mar-19 08:09 UTC
[Rd] suggestion/request: install.packages and unnecessary file modifications
Thank you, Mark, I've now committed (a version of) your suggestion to R-devel (destined to become R 2.9.0 on April 17). Martin Maechler, ETH Zurich>>>>> <Mark.Bravington at csiro.au> >>>>> on Tue, 10 Mar 2009 21:52:30 +1100 writes:> 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) > } > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel