Commit 1b49ff2e authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Debian changes 3.1.2-3

r-base (3.1.2-3) experimental; urgency=low

  * debian/reproducibility-patch/*.patch: Added two patches submitted to R
    upstream and already integrated into upcoming R 3.2.0 releases; these
    help setting a timestamp for the DESCRIPTION file of a) base R package
    via a new env var PKG_BUILT_TIME passed down from debian/rules, and
    also b) r-cran-* package built via r-cran.mk through a new option to 
    R CMD INSTALL                                        (Closes: #774031)

  * debian/rules: Added support for PKG_BUILT_TIME, but left commented-out
  
  * debian/r-cran.mk: Added support for --built-timestampe, also inactive
parent 01af73cc
r-base (3.1.2-3) experimental; urgency=low
* debian/reproducibility-patch/*.patch: Added two patches submitted to R
upstream and already integrated into upcoming R 3.2.0 releases; these
help setting a timestamp for the DESCRIPTION file of a) base R package
via a new env var PKG_BUILT_TIME passed down from debian/rules, and
also b) r-cran-* package built via r-cran.mk through a new option to
R CMD INSTALL (Closes: #774031)
* debian/rules: Added support for PKG_BUILT_TIME, but left commented-out
* debian/r-cran.mk: Added support for --built-timestampe, also inactive
-- Dirk Eddelbuettel <edd@debian.org> Mon, 12 Jan 2015 21:03:42 -0600
r-base (3.1.2-2) unstable; urgency=low
* debian/control: Upgrade Build-Depends: to tcl and tk 8.6
......
......@@ -68,6 +68,17 @@ debRlib := $(CURDIR)/debian/$(package)/$(debRdir)
## optional installation of a lintian silencer
lintiandir := $(CURDIR)/debian/$(package)/usr/share/lintian/overrides
## set built-time in DESCRIPTION time of created binary package based on stamp in changelog
## cf discussion in http://bugs.debian.org/774031 --- and uncomment two assignments here
##
## extract built-timestamp from entry changelog and use as argument
#builttime := $(shell dpkg-parsechangelog -l$(CURDIR)/debian/changelog | awk -F': ' '/Date/ {print $$2}')
##
#builttimeStamp := "--built-timestamp=\"$(builttime)\""
##
## else
builttimeStamp := ""
common-install-indep:: R_any_arch
common-install-arch:: R_any_arch
......@@ -83,10 +94,14 @@ R_any_arch:
if test -f /usr/bin/xvfb-run; then \
$(makeFlagsCall) xvfb-run -a \
R CMD INSTALL -l $(debRlib) --clean \
$(extraInstallFlags) . ; \
$(extraInstallFlags) . \
$(builttimeStamp) \
; \
else \
$(makeFlagsCall) R CMD INSTALL -l $(debRlib) \
--clean $(extraInstallFlags) . ;\
--clean $(extraInstallFlags) . \
$(builttimeStamp) \
; \
fi
## remove extra files which are present in some packages
rm -vf $(debRlib)/R.css \
......
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)
Index: share/make/basepkg.mk
===================================================================
--- share/make/basepkg.mk (revision 67410)
+++ share/make/basepkg.mk (working copy)
@@ -85,15 +85,25 @@
mkdesc:
@if test -f DESCRIPTION; then \
+ if test "$(PKG_BUILT_STAMP)" != ""; then \
+ $(ECHO) "tools:::.install_package_description('.', '$(top_builddir)/library/${pkg}', '$(PKG_BUILT_STAMP)')" | \
+ R_DEFAULT_PACKAGES=NULL $(R_EXE) > /dev/null ; \
+ else \
$(ECHO) "tools:::.install_package_description('.', '$(top_builddir)/library/${pkg}')" | \
R_DEFAULT_PACKAGES=NULL $(R_EXE) > /dev/null ; \
+ fi; \
fi
## for base and tools
mkdesc2:
@$(INSTALL_DATA) DESCRIPTION $(top_builddir)/library/$(pkg)
- @$(ECHO) "Built: R $(VERSION); ; `TZ=UTC date`; $(R_OSTYPE)" \
- >> $(top_builddir)/library/$(pkg)/DESCRIPTION
+ @if test "$(PKG_BUILT_STAMP)" != ""; then \
+ $(ECHO) "Built: R $(VERSION); ; $(PKG_BUILT_STAMP); $(R_OSTYPE)" \
+ >> $(top_builddir)/library/$(pkg)/DESCRIPTION ; \
+ else \
+ $(ECHO) "Built: R $(VERSION); ; `TZ=UTC date`; $(R_OSTYPE)" \
+ >> $(top_builddir)/library/$(pkg)/DESCRIPTION ; \
+ fi
mkdemos:
@$(ECHO) "tools:::.install_package_demos('$(srcdir)', '$(top_builddir)/library/$(pkg)')" | \
......@@ -166,6 +166,12 @@ ldflags = $(shell dpkg-buildflags --get LDFLAGS)
## edd 16 Apr 2008 add -g to optim flags to allow for -dbg package
optimflags += -g
## 12 Jan 2015
## Support for #774031 uncomment the two assignment to pass a non-empty string for this to hold
#builttime := $(shell dpkg-parsechangelog -l$(CURDIR)/debian/changelog | awk -F': ' '/Date/ {print $$2}')
#builttimestamp := "$(builttime)"
buildtimestamp := ""
#arch = kfreebsd-amd64
maketest:
@echo "Hi $(arch)"
......@@ -288,6 +294,7 @@ make-arch-stamp:
CXX=${cxxcompiler} \
${fortrancompiler} \
LDFLAGS="$(ldflags)" \
PKG_BUILT_STAMP="$(buildtimestamp)" \
R
# the top-level 'make stamp-recommended' target implies 'make docs'
......
......@@ -85,15 +85,25 @@ mkRbase:
mkdesc:
@if test -f DESCRIPTION; then \
if test "$(PKG_BUILT_STAMP)" != ""; then \
$(ECHO) "tools:::.install_package_description('.', '$(top_builddir)/library/${pkg}', '$(PKG_BUILT_STAMP)')" | \
R_DEFAULT_PACKAGES=NULL $(R_EXE) > /dev/null ; \
else \
$(ECHO) "tools:::.install_package_description('.', '$(top_builddir)/library/${pkg}')" | \
R_DEFAULT_PACKAGES=NULL $(R_EXE) > /dev/null ; \
fi; \
fi
## for base and tools
mkdesc2:
@$(INSTALL_DATA) DESCRIPTION $(top_builddir)/library/$(pkg)
@$(ECHO) "Built: R $(VERSION); ; `TZ=UTC date`; $(R_OSTYPE)" \
>> $(top_builddir)/library/$(pkg)/DESCRIPTION
@if test "$(PKG_BUILT_STAMP)" != ""; then \
$(ECHO) "Built: R $(VERSION); ; $(PKG_BUILT_STAMP); $(R_OSTYPE)" \
>> $(top_builddir)/library/$(pkg)/DESCRIPTION ; \
else \
$(ECHO) "Built: R $(VERSION); ; `TZ=UTC date`; $(R_OSTYPE)" \
>> $(top_builddir)/library/$(pkg)/DESCRIPTION ; \
fi
mkdemos:
@$(ECHO) "tools:::.install_package_demos('$(srcdir)', '$(top_builddir)/library/$(pkg)')" | \
......
......@@ -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 @@ function(dir, outDir)
"; ",
if(file_test("-d", 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())
......
......@@ -182,6 +182,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",
......@@ -654,7 +656,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")) ) {
......@@ -1277,6 +1279,7 @@
resave_data <- FALSE
compact_docs <- FALSE
keep.source <- getOption("keep.source.pkgs")
built_stamp <- character()
install_libs <- TRUE
install_R <- TRUE
......@@ -1404,6 +1407,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment