summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-04 23:10:15 +0000
committerKarl Berry <karl@freefriends.org>2016-05-04 23:10:15 +0000
commite5ac7d8301efd127740e0ebfde020aae9c9563c0 (patch)
treedf767cacac937f540ded9149064797ca9a31a28f
parent6e6b00930df3ed6b7e295b3b0ed3ef024686a9de (diff)
import SOURCE_DATE_EPOCH_TEX_PRIMITIVES support from pdftex r751, per tex-k thread, http://tug.org/pipermail/tex-k/2016-May/002691.html
git-svn-id: svn://tug.org/texlive/trunk@40889 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/ChangeLog4
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog9
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c70
-rw-r--r--Build/source/texk/web2c/man/pdftex.man72
-rw-r--r--Build/source/texk/web2c/pdftexdir/NEWS10
-rw-r--r--Build/source/texk/web2c/pdftexdir/README18
-rw-r--r--Build/source/texk/web2c/texmfmp-help.h4
-rw-r--r--Master/texmf-dist/doc/man/man1/pdflatex.man1.pdfbin40261 -> 40192 bytes
-rw-r--r--Master/texmf-dist/doc/man/man1/pdftex.172
-rw-r--r--Master/texmf-dist/doc/man/man1/pdftex.man1.pdfbin40261 -> 40192 bytes
-rw-r--r--Master/texmf-dist/doc/pdftex/manual/ChangeLog5
-rw-r--r--Master/texmf-dist/doc/pdftex/manual/Makefile5
-rw-r--r--Master/texmf-dist/doc/pdftex/manual/pdftex-a.pdfbin813349 -> 817102 bytes
-rw-r--r--Master/texmf-dist/doc/pdftex/manual/pdftex-t.tex30
-rw-r--r--Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/Makefile17
-rw-r--r--Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/test-prim.tex11
16 files changed, 202 insertions, 125 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index af6fb41877c..594e37a1f91 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,7 @@
+2016-05-04 Karl Berry <karl@freefriends.org>
+
+ * texmfmp-help.h (PDFTEXHELP) [pdfTeX]: mention pdftex.org.
+
2016-02-27 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* help.h: Add an option -charcode-format in omfonts for compatibility.
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 7a8ede7b015..8062c326881 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,12 @@
+2016-05-04 Karl Berry <karl@freefriends.org>
+
+ * texmfmp.c (init_start_time): new fn, factored out from
+ initstarttime.
+ (get_date_and_time): if envvar SOURCE_DATE_EPOCH_TEX_PRIMITIVES
+ is set, initialize minutes, day, month, year, from
+ SOURCE_DATE_EPOCH value. Requested by Debian, thread starting at
+ http://tug.org/pipermail/tex-k/2016-May/002691.html.
+
2016-04-14 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* texmfmp.c: Fix a bug to show input file name in the case of pipe input.
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index a391445d0fa..c1ad63df96e 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -2200,6 +2200,30 @@ catch_interrupt (int arg)
}
#endif /* not WIN32 */
+static boolean start_time_set = false;
+static time_t start_time = 0;
+
+void init_start_time() {
+ char *source_date_epoch;
+ unsigned long long epoch;
+ char *endptr;
+ if (!start_time_set) {
+ start_time_set = true;
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ errno = 0;
+ epoch = strtoull(source_date_epoch, &endptr, 10);
+ if (epoch < 0 || *endptr != '\0' || errno != 0) {
+FATAL1 ("invalid epoch-seconds-timezone value for environment variable $SOURCE_DATE_EPOCH: %s",
+ source_date_epoch);
+ }
+ start_time = epoch;
+ } else {
+ start_time = time((time_t *) NULL);
+ }
+ }
+}
+
/* Besides getting the date and time here, we also set up the interrupt
handler, for no particularly good reason. It's just that since the
`fix_date_and_time' routine is called early on (section 1337 in TeX,
@@ -2210,8 +2234,24 @@ void
get_date_and_time (integer *minutes, integer *day,
integer *month, integer *year)
{
- time_t myclock = time ((time_t *) 0);
- struct tm *tmptr = localtime (&myclock);
+ struct tm *tmptr;
+ string sde_texprim = getenv ("SOURCE_DATE_EPOCH_TEX_PRIMITIVES");
+ if (sde_texprim && STREQ (sde_texprim, "1")) {
+ init_start_time ();
+ tmptr = gmtime (&start_time);
+ } else {
+ /* whether the envvar was not set (usual case) or invalid,
+ use current time. */
+ time_t myclock = time ((time_t *) 0);
+ tmptr = localtime (&myclock);
+
+ /* warn if they gave an invalid value, empty (null string) ok. */
+ if (sde_texprim && strlen (sde_texprim) > 0
+ && !STREQ (sde_texprim, "0")) {
+WARNING1 ("invalid value (expected 0 or 1) for environment variable $SOURCE_DATE_EPOCH_TEX_PRIMITIVES: %s",
+ sde_texprim);
+ }
+ }
*minutes = tmptr->tm_hour * 60 + tmptr->tm_min;
*day = tmptr->tm_mday;
@@ -2930,8 +2970,7 @@ void pdftex_fail(const char *fmt, ...)
#endif /* not pdfTeX */
#if !defined(XeTeX)
-static boolean start_time_set = false;
-static time_t start_time = 0;
+
#define TIME_STR_SIZE 30
char start_time_str[TIME_STR_SIZE];
static char time_str[TIME_STR_SIZE];
@@ -2996,25 +3035,12 @@ static void makepdftime(time_t t, char *time_str, boolean utc)
void initstarttime(void)
{
- char *source_date_epoch;
- int64_t epoch;
- char *endptr;
if (!start_time_set) {
- start_time_set = true;
- source_date_epoch = getenv("SOURCE_DATE_EPOCH");
- if (source_date_epoch) {
- errno = 0;
- epoch = strtoll(source_date_epoch, &endptr, 10);
- if (epoch < 0 || *endptr != '\0' || errno != 0) {
- FATAL1 ("invalid value for environment variable $SOURCE_DATE_EPOCH: %s",
- source_date_epoch);
- }
- start_time = epoch;
- makepdftime(start_time, start_time_str, /* utc= */true);
- }
- else {
- start_time = time((time_t *) NULL);
- makepdftime(start_time, start_time_str, /* utc= */false);
+ init_start_time ();
+ if (getenv ("SOURCE_DATE_EPOCH")) {
+ makepdftime (start_time, start_time_str, /* utc= */true);
+ } else {
+ makepdftime (start_time, start_time_str, /* utc= */false);
}
}
}
diff --git a/Build/source/texk/web2c/man/pdftex.man b/Build/source/texk/web2c/man/pdftex.man
index 507801dbeb2..d1b8ef5e2d6 100644
--- a/Build/source/texk/web2c/man/pdftex.man
+++ b/Build/source/texk/web2c/man/pdftex.man
@@ -1,4 +1,4 @@
-.TH PDFTEX 1 "16 June 2015" "Web2C @VERSION@"
+.TH PDFTEX 1 "4 May 2016" "Web2C @VERSION@"
.\"=====================================================================
.if n .ds MF Metafont
.if t .ds MF Metafont
@@ -318,7 +318,7 @@ line can overrule this setting.
Print version information and exit.
.\"=====================================================================
.SH ENVIRONMENT
-See the Kpathsearch library documentation (the `Path specifications'
+See the Kpathsea library documentation (e.g., the `Path specifications'
node) for precise details of how the environment variables are used.
The
.B kpsewhich
@@ -364,11 +364,6 @@ current directory and ``/home/user/tex'' to the standard search path.
.B TEXFORMATS
Search path for format files.
.TP
-.B TEXPOOL
-search path for
-.B pdftex
-internal strings.
-.TP
.B TEXEDIT
Command template for switching to editor. The default, usually
.BR vi ,
@@ -378,6 +373,27 @@ is set when pdf\*(TX is compiled.
Search path for font metric
.RI ( .tfm )
files.
+.TP
+.B SOURCE_DATE_EPOCH
+If set, its value, taken to be in epoch-seconds, will be used for the
+timestamps in the PDF output, such as the CreationDate and ModDate keys.
+This is useful for making reproducible builds.
+.TP
+.B SOURCE_DATE_EPOCH_TEX_PRIMITIVES
+If set to the value "1", the time-related \*(TX primitives
+.RI ( \eyear ,
+.IR \emonth ,
+.IR \eday ,
+.IR \etime )
+are also initialized from the value of SOURCE_DATE_EPOCH. This is not
+recommended if there is any viable alternative.
+.br
+pdf\*(TX also has several primitives to support reproducible builds,
+which are preferable to setting these environment variables; see the
+main manual.
+.PP
+Many, many more environment variables may be consulted related to path
+searching. See the Kpathsea manual.
.\"=====================================================================
.SH FILES
The location of the files mentioned below varies from system to
@@ -385,11 +401,8 @@ system. Use the
.B kpsewhich
utility to find their locations.
.TP
-.I pdftex.pool
-Text file containing pdf\*(TX's internal strings.
-.TP
.I pdftex.map
-Filename mapping definitions.
+Font name mapping definitions.
.TP
.I *.tfm
Metric files for pdf\*(TX's fonts.
@@ -409,14 +422,6 @@ and the info manual
.IR "Web2C: A TeX implementation" .
.\"=====================================================================
.SH BUGS
-This version of pdf\*(TX implements a number of optional extensions.
-In fact, many of these extensions conflict to a greater or lesser
-extent with the definition of pdf\*(TX. When such extensions are
-enabled, the banner printed when pdf\*(TX starts is changed to print
-.B pdfTeXk
-instead of
-.BR pdfTeX .
-.PP
This version of pdf\*(TX fails to trap arithmetic overflow when
dimensions are added or subtracted. Cases where this occurs are rare,
but when it does the generated
@@ -427,27 +432,19 @@ file would be usable is unknown.
.\"=====================================================================
.SH AVAILABILITY
pdf\*(TX is available for a large variety of machine architectures
-and operation systems.
+and operating systems.
pdf\*(TX is part of all major \*(TX distributions.
-.P
-Information on how to get pdf\*(TX and related information
-is available at the
-.B http://www.pdftex.org
-.IR "pdf\*(TX"
-web site.
-.P
-The following pdfe\*(TX related mailing list is available:
-.BR pdftex@tug.org .
-This is a mailman list;
-to subscribe send a message containing
-.I subscribe
-to
-.BR pdftex-request@tug.org .
-A web interface and list archives can be found at the
-.B "http://lists.tug.org/pdftex"
-mailing list web site.
+.br
+The pdf\*(TX home page: http://www.pdftex.org.
+.br
+pdf\*(TX on CTAN: http://www.ctan.org/pkg/pdftex.
+.br
+pdf\*(TX mailing list for all discussion: http://lists.tug.org/pdftex.
.\"=====================================================================
.SH "SEE ALSO"
+The full pdf\*(TX manual can be accessed from the home page or CTAN page.
+Same for the Web2C, Kpathsea, and other manuals.
+Some related programs:
.BR epstopdf (1),
.BR etex (1),
.BR latex (1),
@@ -455,7 +452,6 @@ mailing list web site.
.BR mptopdf (1),
.BR tex (1),
.BR mf (1).
-http://pdftex.org, http://tug.org/web2c.
.\"=====================================================================
.SH AUTHORS
The primary authors of pdf\*(TX are Han The Thanh, Petr Sojka,
diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS
index 7171ee730ef..bd682a8b045 100644
--- a/Build/source/texk/web2c/pdftexdir/NEWS
+++ b/Build/source/texk/web2c/pdftexdir/NEWS
@@ -1,9 +1,13 @@
pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016)
- changes:
- - if environment variable SOURCE_DATE_EPOCH is set, use its value for
- the CreationDate and ModDate values, and to seed the trailer /ID.
+ - if the environment variable SOURCE_DATE_EPOCH is set, use its value for
+ the PDF CreationDate and ModDate values, and to seed the trailer /ID.
This by itself should suffice to create reproducible PDFs. The
- other changes support more granular output tweaks along the same lines.
+ new primitives below support more granular output tweaks with the
+ same intent.
+ - if the environment variable SOURCE_DATE_EPOCH_TEX_PRIMITIVES is set
+ to 1, the \year, \day, and \time primitives are also initialized
+ from the SOURCE_DATE_EPOCH value, instead of the current time.
- new primitive \pdfinfoomitdate to omit CreationDate and ModDate keys.
- new primitive \pdftrailerid to set seed for the trailer /ID
diff --git a/Build/source/texk/web2c/pdftexdir/README b/Build/source/texk/web2c/pdftexdir/README
index 9b78615b002..785ab5b4595 100644
--- a/Build/source/texk/web2c/pdftexdir/README
+++ b/Build/source/texk/web2c/pdftexdir/README
@@ -2,14 +2,16 @@ pdfTeX is an extended version of eTeX that can create PDF directly from
TeX source files and enhance the result of TeX typesetting with the help
of PDF. When PDF output is not selected, pdfTeX produces normal DVI
output, otherwise it produces PDF output that looks essentially
-identical to the DVI output. An important aspect of this project was to
-investigate alternative justification algorithms, resulting in the
-margin kerning and font expansion "microtypgraphy" features, inspired by
-Peter Karow.
-
-pdfTeX is based on the original e-TeX sources and Web2c, and has been
-successfully compiled on many systems. It is actively maintained, but
-stability is paramount now; only bug fixes and small enhancements are expected.
+identical to the DVI output
+
+An important aspect of this project was to investigate alternative
+justification algorithms, resulting in the "microtypography" features of
+margin kerning and font expansion. This was inspired by Peter Karow's
+and Hermann Zapf's work.
+
+pdfTeX is integrated with the original e-TeX sources and Web2c. It is
+actively maintained, but stability is paramount now; only bug fixes and
+small enhancements are expected. Releases are made through TeX Live.
See the file NEWS for changes to the program.
Documentation about pdfTeX can be found at http://www.pdftex.org.
diff --git a/Build/source/texk/web2c/texmfmp-help.h b/Build/source/texk/web2c/texmfmp-help.h
index 6a0dba4b676..b6a5f9ddee3 100644
--- a/Build/source/texk/web2c/texmfmp-help.h
+++ b/Build/source/texk/web2c/texmfmp-help.h
@@ -1,6 +1,6 @@
/* The help messages for TeX & MF family of programs.
-Copyright 1995, 1996, 2008-2015 Karl Berry.
+Copyright 1995, 1996, 2008-2016 Karl Berry.
Copyright 2001-05 Olaf Weber.
This program is free software; you can redistribute it and/or modify
@@ -464,6 +464,8 @@ const_string PDFTEXHELP[] = {
"-8bit make all characters printable by default",
"-help display this help and exit",
"-version output version information and exit",
+ "",
+ "pdfTeX home page: <http://pdftex.org>",
NULL
};
#endif /* pdfTeX */
diff --git a/Master/texmf-dist/doc/man/man1/pdflatex.man1.pdf b/Master/texmf-dist/doc/man/man1/pdflatex.man1.pdf
index 5a2834ffe1c..7a5f4a9ebee 100644
--- a/Master/texmf-dist/doc/man/man1/pdflatex.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/pdflatex.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/man/man1/pdftex.1 b/Master/texmf-dist/doc/man/man1/pdftex.1
index eb255815aee..f1b1c2c9231 100644
--- a/Master/texmf-dist/doc/man/man1/pdftex.1
+++ b/Master/texmf-dist/doc/man/man1/pdftex.1
@@ -1,4 +1,4 @@
-.TH PDFTEX 1 "16 June 2015" "Web2C 2016"
+.TH PDFTEX 1 "4 May 2016" "Web2C 2016"
.\"=====================================================================
.if n .ds MF Metafont
.if t .ds MF Metafont
@@ -318,7 +318,7 @@ line can overrule this setting.
Print version information and exit.
.\"=====================================================================
.SH ENVIRONMENT
-See the Kpathsearch library documentation (the `Path specifications'
+See the Kpathsea library documentation (e.g., the `Path specifications'
node) for precise details of how the environment variables are used.
The
.B kpsewhich
@@ -364,11 +364,6 @@ current directory and ``/home/user/tex'' to the standard search path.
.B TEXFORMATS
Search path for format files.
.TP
-.B TEXPOOL
-search path for
-.B pdftex
-internal strings.
-.TP
.B TEXEDIT
Command template for switching to editor. The default, usually
.BR vi ,
@@ -378,6 +373,27 @@ is set when pdf\*(TX is compiled.
Search path for font metric
.RI ( .tfm )
files.
+.TP
+.B SOURCE_DATE_EPOCH
+If set, its value, taken to be in epoch-seconds, will be used for the
+timestamps in the PDF output, such as the CreationDate and ModDate keys.
+This is useful for making reproducible builds.
+.TP
+.B SOURCE_DATE_EPOCH_TEX_PRIMITIVES
+If set to the value "1", the time-related \*(TX primitives
+.RI ( \eyear ,
+.IR \emonth ,
+.IR \eday ,
+.IR \etime )
+are also initialized from the value of SOURCE_DATE_EPOCH. This is not
+recommended if there is any viable alternative.
+.br
+pdf\*(TX also has several primitives to support reproducible builds,
+which are preferable to setting these environment variables; see the
+main manual.
+.PP
+Many, many more environment variables may be consulted related to path
+searching. See the Kpathsea manual.
.\"=====================================================================
.SH FILES
The location of the files mentioned below varies from system to
@@ -385,11 +401,8 @@ system. Use the
.B kpsewhich
utility to find their locations.
.TP
-.I pdftex.pool
-Text file containing pdf\*(TX's internal strings.
-.TP
.I pdftex.map
-Filename mapping definitions.
+Font name mapping definitions.
.TP
.I *.tfm
Metric files for pdf\*(TX's fonts.
@@ -409,14 +422,6 @@ and the info manual
.IR "Web2C: A TeX implementation" .
.\"=====================================================================
.SH BUGS
-This version of pdf\*(TX implements a number of optional extensions.
-In fact, many of these extensions conflict to a greater or lesser
-extent with the definition of pdf\*(TX. When such extensions are
-enabled, the banner printed when pdf\*(TX starts is changed to print
-.B pdfTeXk
-instead of
-.BR pdfTeX .
-.PP
This version of pdf\*(TX fails to trap arithmetic overflow when
dimensions are added or subtracted. Cases where this occurs are rare,
but when it does the generated
@@ -427,27 +432,19 @@ file would be usable is unknown.
.\"=====================================================================
.SH AVAILABILITY
pdf\*(TX is available for a large variety of machine architectures
-and operation systems.
+and operating systems.
pdf\*(TX is part of all major \*(TX distributions.
-.P
-Information on how to get pdf\*(TX and related information
-is available at the
-.B http://www.pdftex.org
-.IR "pdf\*(TX"
-web site.
-.P
-The following pdfe\*(TX related mailing list is available:
-.BR pdftex@tug.org .
-This is a mailman list;
-to subscribe send a message containing
-.I subscribe
-to
-.BR pdftex-request@tug.org .
-A web interface and list archives can be found at the
-.B "http://lists.tug.org/pdftex"
-mailing list web site.
+.br
+The pdf\*(TX home page: http://www.pdftex.org.
+.br
+pdf\*(TX on CTAN: http://www.ctan.org/pkg/pdftex.
+.br
+pdf\*(TX mailing list for all discussion: http://lists.tug.org/pdftex.
.\"=====================================================================
.SH "SEE ALSO"
+The full pdf\*(TX manual can be accessed from the home page or CTAN page.
+Same for the Web2C, Kpathsea, and other manuals.
+Some related programs:
.BR epstopdf (1),
.BR etex (1),
.BR latex (1),
@@ -455,7 +452,6 @@ mailing list web site.
.BR mptopdf (1),
.BR tex (1),
.BR mf (1).
-http://pdftex.org, http://tug.org/web2c.
.\"=====================================================================
.SH AUTHORS
The primary authors of pdf\*(TX are Han The Thanh, Petr Sojka,
diff --git a/Master/texmf-dist/doc/man/man1/pdftex.man1.pdf b/Master/texmf-dist/doc/man/man1/pdftex.man1.pdf
index 7e9c4e2796d..f4429301ad3 100644
--- a/Master/texmf-dist/doc/man/man1/pdftex.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/pdftex.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/pdftex/manual/ChangeLog b/Master/texmf-dist/doc/pdftex/manual/ChangeLog
index 220c0ca6ad4..3e3cb1168fa 100644
--- a/Master/texmf-dist/doc/pdftex/manual/ChangeLog
+++ b/Master/texmf-dist/doc/pdftex/manual/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-04 Karl Berry <karl@freefriends.org>
+
+ * pdftex-t.tex (Invoking \PDFTEX): describe
+ SOURCE_DATE_EPOCH_TEX_PRIMITIVES, with caveats.
+
2016-04-25 Karl Berry <karl@freefriends.org>
* samplepdf: move subdir up a level for more visibility.
diff --git a/Master/texmf-dist/doc/pdftex/manual/Makefile b/Master/texmf-dist/doc/pdftex/manual/Makefile
index 001768d614b..102d82ff576 100644
--- a/Master/texmf-dist/doc/pdftex/manual/Makefile
+++ b/Master/texmf-dist/doc/pdftex/manual/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 745 2016-04-25 18:06:57Z karl $
+# $Id: Makefile 751 2016-05-04 22:57:38Z karl $
# Makefile for pdfTeX documentation. Public domain.
# Get version we're documenting from the \def in the manual.
@@ -58,8 +58,9 @@ pdftex-w.pdf: pdftex-w.tex
# Too annoying to remake help text every time; check by hand when needed.
-pdftex-help.txt:
+pdftex-help.txt: force
$(pdftex_binary) --help >$@ || rm -f $@
+force:
# if we don't have a build tree around, just try from the path.
build_binary := ../../source/build-pdftex/texk/web2c/pdftex
diff --git a/Master/texmf-dist/doc/pdftex/manual/pdftex-a.pdf b/Master/texmf-dist/doc/pdftex/manual/pdftex-a.pdf
index 8de0d2cb619..d220e5ca648 100644
--- a/Master/texmf-dist/doc/pdftex/manual/pdftex-a.pdf
+++ b/Master/texmf-dist/doc/pdftex/manual/pdftex-a.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/pdftex/manual/pdftex-t.tex b/Master/texmf-dist/doc/pdftex/manual/pdftex-t.tex
index 9ae584c7c5e..fd2054a33f5 100644
--- a/Master/texmf-dist/doc/pdftex/manual/pdftex-t.tex
+++ b/Master/texmf-dist/doc/pdftex/manual/pdftex-t.tex
@@ -1,7 +1,7 @@
% interface=english modes=letter,screen output=pdftex
% vim: tw=79
-% $Id: pdftex-t.tex 745 2016-04-25 18:06:57Z karl $
+% $Id: pdftex-t.tex 751 2016-05-04 22:57:38Z karl $
% The number of lines on the title page depends on exactly
% what \PDF\ code is generated.
@@ -38,7 +38,7 @@
August\or September\or October\or November\or December\else ERROR\fi}
}
-\svnscan $Id: pdftex-t.tex 745 2016-04-25 18:06:57Z karl $
+\svnscan $Id: pdftex-t.tex 751 2016-05-04 22:57:38Z karl $
\def\currentpdftex{1.40.17}
@@ -1313,20 +1313,36 @@ engines as implemented in \WEBC\ (\from [web2c] has the manual).
The same commonality holds for environment variables; see the section
``Setting search paths'' above for an overview. However, \PDFTEX\ looks
-for one additional environment variable: \type{SOURCE_DATE_EPOCH}
+for two additional environment variables: first, \type{SOURCE_DATE_EPOCH}
(introduced in version 1.40.17, 2016). If this is set, it must be a
positive integer (with one trivial exception: if it is set but empty,
that is equivalent to 0). Non-integer values cause a fatal error. The
value is used as the current time in seconds since the usual Unix
-``epoch'', the beginning of 1970-01-01, UTC. Thus, a value of \type{32}
+``epoch'': the beginning of 1970-01-01, UTC. Thus, a value of \type{32}
would result in a \type{/CreationDate} and \type{/ModDate} values of
\type{19700101000032Z}. This is useful for reproducible builds of
documents. (See also \type{\pdfinfoomitdate},
\type{\pdfsuppressptexinfo}, et al.)
-Just to have the list of options and basic invocation at hand, here is a
-verbatim listing of the \type{-}\type{-help} output. All options can be
-specified with one or two dashes and unambiguously abbreviated.
+The second \PDFTEX-specific environment variable is
+\type{SOURCE_DATE_EPOCH_TEX_PRIMITIVES}. If this is set to~\type{1},
+\TEX's time-related primitives are also initialized from the value of
+\type{SOURCE_DATE_EPOCH}. These primitives are \type{\year},
+\type{\month}, \type{day}, and \type{\time}. If
+\type{SOURCE_DATE_EPOCH} is not set, setting
+\type{SOURCE_DATE_EPOCH_TEX_PRIMITIVES} has no effect. If
+\type{SOURCE_DATE_EPOCH_TEX_PRIMITIVES} is unset, set to the empty
+string, or set to~\type{0}, the primitives reflect the current time as
+usual. Any other value elicits a warning, and the current time is used.
+(This is useful only if one wants to make reproducible \PDF{}s for a set
+of documents without changing them in any way, e.g., an operating system
+distribution with manuals that use \type{\today}. Except in such
+unusual circumstances, it is better not to set this, and let the \TEX\
+primitives have the meaning they have always had.)
+
+Now, just to have the list of options and basic invocation at hand, here
+is a verbatim listing of the \type{-}\type{-help} output. All options
+can be specified with one or two dashes and unambiguously abbreviated.
\startnotmode[screen]
\switchtobodyfont[9pt] % squeeze everything on one page
diff --git a/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/Makefile b/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/Makefile
index cbf7ee13b25..1e0e72aea9c 100644
--- a/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/Makefile
+++ b/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 740 2016-04-23 15:08:37Z karl $
+# $Id: Makefile 751 2016-05-04 22:57:38Z karl $
# Public domain.
include ../Common.mak
@@ -9,6 +9,10 @@ test1:
test2:
$(prog) test-fixed-date-id.tex
+testprim:
+ SOURCE_DATE_EPOCH=120 SOURCE_DATE_EPOCH_TEX_PRIMITIVES=1 \
+ $(prog) test-prim.tex
+
test = test-SOURCE_DATE_EPOCH
# test invalid settings of the envvar.
test3-invalid:
@@ -27,17 +31,18 @@ test3-valid: test3-orig.pdf test3-repro.pdf
SOURCE_DATE_EPOCH=0 $(prog) $(test).tex
SOURCE_DATE_EPOCH="" $(prog) $(test).tex # same as 0
-$(diff) $< $(test).pdf # shows differences
- SOURCE_DATE_EPOCH=10 $(prog) $(test).tex
+ SOURCE_DATE_EPOCH=11 $(prog) $(test).tex
$(diff) test3-repro.pdf $(test).pdf # should be identical
# SOURCE_DATE_EPOCH=1439928155 $(prog) $(test).tex
# make an original with nonzero time for checking.
-test3-repro.pdf:
- SOURCE_DATE_EPOCH=10 $(prog) $(test).tex && mv $(test).pdf $@
+test3-repro.pdf: force
+ SOURCE_DATE_EPOCH=11 $(prog) $(test).tex && mv $(test).pdf $@
+force:
clean:
rm -f *.log *.pdf *.fmt *.aux
fmt:
- $(prog) *pdflatex.ini
- $(prog) *pdfetex.ini
+ $(prog) \*pdflatex.ini
+ $(prog) \*pdfetex.ini
diff --git a/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/test-prim.tex b/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/test-prim.tex
new file mode 100644
index 00000000000..7c83d90b422
--- /dev/null
+++ b/Master/texmf-dist/doc/pdftex/tests/03-deterministic-output/test-prim.tex
@@ -0,0 +1,11 @@
+% $Id$
+% See the testprim: target in ./Makefile for the invocation.
+
+\catcode`\{ = 1
+\catcode`\} = 2
+
+\ifnum\year=1970 \else \errmessage{year is \the\year, not 1970}\fi
+\ifnum\month=1 \else \errmessage{month is \the\month, not 1}\fi
+\ifnum\day=1 \else \errmessage{day is \the\day, not 1}\fi
+\ifnum\time=2 \else \errmessage{time is \the\time, not 2}\fi
+\end