texlive[45808] Build/source/texk/web2c/pdftexdir: use only file base
commits+karl at tug.org
commits+karl at tug.org
Wed Nov 15 00:50:55 CET 2017
Revision: 45808
http://tug.org/svn/texlive?view=revision&revision=45808
Author: karl
Date: 2017-11-15 00:50:55 +0100 (Wed, 15 Nov 2017)
Log Message:
-----------
use only file base name, not cwd, when computing PDF ID (pdftex r782)
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=782
Modified Paths:
--------------
trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
trunk/Build/source/texk/web2c/pdftexdir/NEWS
trunk/Build/source/texk/web2c/pdftexdir/utils.c
Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2017-11-14 22:38:24 UTC (rev 45807)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2017-11-14 23:50:55 UTC (rev 45808)
@@ -1,3 +1,11 @@
+2017-11-14 Anders Kaseorg <andersk at mit.edu>
+
+ * utils.c (printID): Do not hash the current directory name into
+ the PDF ID field, since any variability in it leads to
+ non-reproducible builds.
+ pdftex mailing list, 2 Sep 2017 01:52:43
+ https://bugs.debian.org/874102
+
2017-10-17 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
* pdftosrc.cc: Support also xpdf-3.04 if XPDF304 is defined.
Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS 2017-11-14 22:38:24 UTC (rev 45807)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS 2017-11-14 23:50:55 UTC (rev 45808)
@@ -1,6 +1,11 @@
+- changes:
+ - do not hash current directory into PDF ID, for more reproducible builds.
+
- bugfixes:
- \ifpdfprimitive now correctly returns true for "\ " (r45394).
+- source: support xpdf-4 by default, or xpdf-3.04,
+ or poppler-0.59.0 and newer, or poppler-0.57.0 and older, via #defines.
---------------------------------------------------------------
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017) (April 27, 2017)
- changes:
Modified: trunk/Build/source/texk/web2c/pdftexdir/utils.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/utils.c 2017-11-14 22:38:24 UTC (rev 45807)
+++ trunk/Build/source/texk/web2c/pdftexdir/utils.c 2017-11-14 23:50:55 UTC (rev 45808)
@@ -1,5 +1,5 @@
/*
-Copyright 1996-2015 Han The Thanh, <thanh at pdftex.org>
+Copyright 1996-2017 Han The Thanh, <thanh at pdftex.org>
This file is part of pdfTeX.
@@ -697,9 +697,10 @@
</blockquote>
This stipulates only that the two IDs must be identical when the file is
created and that they should be reasonably unique. Since it's difficult
- to get the file size at this point in the execution of pdfTeX and
- scanning the info dict is also difficult, we start with a simpler
- implementation using just the first two items.
+ to get the file size at this point in the execution of pdfTeX, scanning
+ the info dict is also difficult, and any variability in the current
+ directory name leads to non-reproducible builds, we start with a
+ simpler implementation using just the current time and the file name.
*/
void printID(strnumber filename)
{
@@ -707,7 +708,6 @@
md5_byte_t digest[16];
char id[64];
char *file_name;
- char pwd[4096];
/* start md5 */
md5_init(&state);
/* get the time */
@@ -714,22 +714,7 @@
initstarttime();
md5_append(&state, (const md5_byte_t *) start_time_str, strlen(start_time_str));
/* get the file name */
- if (getcwd(pwd, sizeof(pwd)) == NULL)
- pdftex_fail("getcwd() failed (%s), path too long?", strerror(errno));
-#ifdef WIN32
- {
- char *p;
- for (p = pwd; *p; p++) {
- if (*p == '\\')
- *p = '/';
- else if (IS_KANJI(p))
- p++;
- }
- }
-#endif
file_name = makecstring(filename);
- md5_append(&state, (const md5_byte_t *) pwd, strlen(pwd));
- md5_append(&state, (const md5_byte_t *) "/", 1);
md5_append(&state, (const md5_byte_t *) file_name, strlen(file_name));
/* finish md5 */
md5_finish(&state, digest);
More information about the tex-live-commits
mailing list