1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
Index: src/library/tools/R/admin.R
===================================================================
--- src/library/tools/R/admin.R (revision 67410)
+++ src/library/tools/R/admin.R (working copy)
@@ -21,7 +21,7 @@
## called from basepkg.mk and .install_packages
.install_package_description <-
-function(dir, outDir)
+function(dir, outDir, builtStamp=character())
{
## Function for taking the DESCRIPTION package meta-information,
## checking/validating it, and installing it with the 'Built:'
@@ -66,8 +66,9 @@
"; ",
if(dir.exists(file.path(dir, "src"))) OStype else "",
"; ",
+ ## Some build systems want to supply a package-build timestamp for reproducibility
## Prefer date in ISO 8601 format, UTC.
- format(Sys.time(), tz = "UTC", usetz = TRUE),
+ if (length(builtStamp)==0) format(Sys.time(), tz = "UTC", usetz = TRUE) else builtStamp,
## Sys.time(),
"; ",
.OStype())
Index: src/library/tools/R/install.R
===================================================================
--- src/library/tools/R/install.R (revision 67410)
+++ src/library/tools/R/install.R (working copy)
@@ -180,6 +180,8 @@
" --configure-vars=VARS",
" set variables for the configure scripts (if any)",
" --dsym (OS X only) generate dSYM directory",
+ " --built-timestamp=STAMP",
+ " set timestamp for Built: entry in DESCRIPTION",
"\nand on Windows only",
" --force-biarch attempt to build both architectures",
" even if there is a non-empty configure.win",
@@ -652,7 +654,7 @@
Sys.chmod(file.path(instdir, f), fmode)
}
- res <- try(.install_package_description('.', instdir))
+ res <- try(.install_package_description('.', instdir, built_stamp))
if (inherits(res, "try-error"))
pkgerrmsg("installing package DESCRIPTION failed", pkg_name)
if (!file.exists(namespace <- file.path(instdir, "NAMESPACE")) ) {
@@ -1274,6 +1276,7 @@
resave_data <- FALSE
compact_docs <- FALSE
keep.source <- getOption("keep.source.pkgs")
+ built_stamp <- character()
install_libs <- TRUE
install_R <- TRUE
@@ -1401,6 +1404,8 @@
byte_compile <- FALSE
} else if (a == "--dsym") {
dsym <- TRUE
+ } else if (substr(a, 1, 18) == "--built-timestamp=") {
+ built_stamp <- substr(a, 19, 1000)
} else if (substr(a, 1, 1) == "-") {
message("Warning: unknown option ", sQuote(a), domain = NA)
} else pkgs <- c(pkgs, a)
|