[Reproducible-commits] [texlive-bin] 02/05: Modified function to produce timezone independent timestamps using UTC

Reiner Herrmann reiner at reiner-h.de
Thu Mar 3 23:25:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch pu/reproducible_builds
in repository texlive-bin.

commit 749173e71bee083fd77b46961be575698ee256f4
Author: akira <marivalenm at gmail.com>
Date:   Mon Aug 10 10:02:51 2015 +0200

    Modified function to produce timezone independent timestamps using UTC
---
 .../Use-gmtime-to-produce-reproducible-output      | 50 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 51 insertions(+)

diff --git a/debian/patches/Use-gmtime-to-produce-reproducible-output b/debian/patches/Use-gmtime-to-produce-reproducible-output
new file mode 100644
index 0000000..93a2df8
--- /dev/null
+++ b/debian/patches/Use-gmtime-to-produce-reproducible-output
@@ -0,0 +1,50 @@
+Description: Use gmtime instead of localtime to produce timezone independent output if SOURCE_DATE_EPOCH is set
+
+--- a/texk/web2c/lib/texmfmp.c
++++ b/texk/web2c/lib/texmfmp.c
+@@ -2876,7 +2876,7 @@ char start_time_str[TIME_STR_SIZE];
+ static char time_str[TIME_STR_SIZE];
+     /* minimum size for time_str is 24: "D:YYYYmmddHHMMSS+HH'MM'" */
+ 
+-static void makepdftime(time_t t, char *time_str)
++static void makepdftime(time_t t, char *time_str, int utc)
+ {
+ 
+     struct tm lt, gmt;
+@@ -2884,7 +2884,12 @@ static void makepdftime(time_t t, char *
+     int i, off, off_hours, off_mins;
+ 
+     /* get the time */
+-    lt = *localtime(&t);
++    if (utc){
++        lt = *gmtime(&t);
++    }
++    else {
++        lt = *localtime(&t);
++    }
+     size = strftime(time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", &lt);
+     /* expected format: "YYYYmmddHHMMSS" */
+     if (size == 0) {
+@@ -2958,11 +2963,12 @@ void initstarttime(void)
+ 			uexit(EXIT_FAILURE);
+ 		}
+ 		start_time = epoch;
++		makepdftime(start_time, start_time_str, 1);
+ 	}
+ 	else {
+ 		start_time = time((time_t *) NULL);
++		makepdftime(start_time, start_time_str, 0);
+ 	}
+-        makepdftime(start_time, start_time_str);
+     }
+ }
+ 
+@@ -3049,7 +3055,7 @@ void getfilemoddate(integer s)
+     if (stat(file_name, &file_data) == 0) {
+         size_t len;
+ 
+-        makepdftime(file_data.st_mtime, time_str);
++        makepdftime(file_data.st_mtime, time_str, 0);
+         len = strlen(time_str);
+         if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) {
+             poolptr = poolsize;
diff --git a/debian/patches/series b/debian/patches/series
index c14513e..0cafcd6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,6 +11,7 @@ mktexlsr-use-mktemp
 dvihp-use-mktemp
 remove-libdir-from-kpathsea-pkgconfig
 honour-source-date-epoch
+Use-gmtime-to-produce-reproducible-output
 # from here on upstream patches
 upstream-svn37801-xobjcect-typo
 upstream-svn38047-dvipdfmx-fix

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/texlive-bin.git



More information about the Reproducible-commits mailing list