[Rd] recent changes to r-devel with package date checking?
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Sun Mar 29 16:40:32 CEST 2026
Hi Simon,
I put up bug report 19037 with the diff below. Now we can pass a timestamp
in, and if it in RFC 822 format, it gets transformed into ISO 8601 format.
Demo and diff below, hope it helps.
Cheers, Dirk
### Demo
Using anytime to create an RFC 822 date:
edd using paul:~/git/tidycpp(master)$ Rscript --vanilla -e 'cat(anytime::rfc2822(Sys.time()),"\n")'
Sun, 29 Mar 2026 09:36:29 -0500
edd using paul:~/git/tidycpp(master)$
edd using paul:~/git/tidycpp(master)$ RD CMD INSTALL --built-timestamp='Sun, 29 Mar 2026 09:36:29 -0500' .
* installing to library ‘/usr/local/lib/R-devel/lib/R/library’
* installing *source* package ‘tidyCpp’ ...
** this is package ‘tidyCpp’ version ‘0.0.11’
** using staged installation
** inst
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (tidyCpp)
edd using paul:~/git/tidycpp(master)$ grep Built /usr/local/lib/R-devel/lib/R/library/tidyCpp/DESCRIPTION
Built: R 4.7.0; ; 2026-03-29 14:36:29 UTC; unix
edd using paul:~/git/tidycpp(master)$
Or if we want one from a debian/changelog:
edd using paul:~/git/tidycpp(master)$ grep ' -- Dirk' ~/deb/r-base/debian/changelog | head -1
-- Dirk Eddelbuettel <edd using debian.org> Wed, 11 Mar 2026 07:09:46 -0500
edd using paul:~/git/tidycpp(master)$
edd using paul:~/git/tidycpp(master)$ RD CMD INSTALL --built-timestamp='Wed, 11 Mar 2026 07:09:46 -0500' .
* installing to library ‘/usr/local/lib/R-devel/lib/R/library’
* installing *source* package ‘tidyCpp’ ...
** this is package ‘tidyCpp’ version ‘0.0.11’
** using staged installation
** inst
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (tidyCpp)
edd using paul:~/git/tidycpp(master)$ grep Built /usr/local/lib/R-devel/lib/R/library/tidyCpp/DESCRIPTION
Built: R 4.7.0; ; 2026-03-11 12:09:46 UTC; unix
edd using paul:~/git/tidycpp(master)$
### Diff (also in bug report 19037)
edd using paul:~/git/tidycpp(master)$ cat /tmp/r/r-builtstamp-r89738.updated.diff
Index: src/library/tools/R/admin.R
===================================================================
--- src/library/tools/R/admin.R (revision 89738)
+++ src/library/tools/R/admin.R (working copy)
@@ -1,7 +1,7 @@
# File src/library/tools/R/admin.R
# Part of the R package, https://www.R-project.org
#
-# Copyright (C) 1995-2025 The R Core Team
+# Copyright (C) 1995-2026 The R Core Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -65,6 +65,12 @@
## Prefer date in ISO 8601 format, UTC, avoid sub-seconds.
builtStamp <- format(Sys.time(), "%Y-%m-%d %H:%M:%S",
tz = "UTC", usetz = TRUE)
+ } else {
+ ## Debian may have passed a timestamp in RFC 822 format,
+ ## if it parses use it but as ISO 8601, UTC, no sub-seconds
+ if (!is.na(res <- strptime(builtStamp, "%a, %d %b %Y %T %z", tz="UTC")))
+ builtStamp <- format(res, "%Y-%m-%d %H:%M:%S",
+ tz = "UTC", usetz = TRUE)
}
Built <-
paste0("R ",
edd using paul:~/git/tidycpp(master)$
--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-devel
mailing list