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

Maria Valentina Marin Rodrigues akira-guest at moszumanska.debian.org
Wed Aug 12 07:28:33 UTC 2015


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

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

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

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

diff --git a/debian/changelog b/debian/changelog
index c09eae6..14ec57e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+texlive-bin (2015.20150524.37493-5.1~reproducible2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch Use-gmtime-to-produce-reproducible-output which modifies function makepdftime to produce timezone independent timestamps by using UTC
+
+ -- akira <marivalenm at gmail.com>  Mon, 10 Aug 2015 09:51:23 +0200
+
 texlive-bin (2015.20150524.37493-5.1~reproducible1) unstable; urgency=medium
 
   * Non-maintainer upload.
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 8b8c0d0..3a7d994 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ mktexlsr-use-mktemp
 dvihp-use-mktemp
 remove-libdir-from-kpathsea-pkgconfig
 honour-source-date-epoch
+Use-gmtime-to-produce-reproducible-output

-- 
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