[Reproducible-commits] [gettext] 01/01: Added patch to honour SOURCE_DATE_EPOCH

Eduard Sanou dhole-guest at moszumanska.debian.org
Mon Jul 13 18:52:43 UTC 2015


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

dhole-guest pushed a commit to branch pu/reproducible_builds
in repository gettext.

commit 23cc26c7f051438b2f0c0a86f07acf876fca61fb
Author: Dhole <dhole at openmailbox.org>
Date:   Mon Jul 13 20:52:23 2015 +0200

    Added patch to honour SOURCE_DATE_EPOCH
---
 debian/changelog                                   |  8 +++++
 .../03-Replace-timestamp-with-SOURCE_DATE_EPOCH    | 38 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 47 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8620293..db30c98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gettext (0.19.4-1.1.0~reproducible1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add support for reproducible builds by using $SOURCE_DATE_EPOCH as the
+    date on creation of PO files with xgettext.
+
+ -- Dhole <dhole at openmailbox.org>  Fri, 10 Jul 2015 18:07:30 +0200
+
 gettext (0.19.4-1) unstable; urgency=low
 
   * New upstream release.
diff --git a/debian/patches/03-Replace-timestamp-with-SOURCE_DATE_EPOCH b/debian/patches/03-Replace-timestamp-with-SOURCE_DATE_EPOCH
new file mode 100644
index 0000000..7bdec9a
--- /dev/null
+++ b/debian/patches/03-Replace-timestamp-with-SOURCE_DATE_EPOCH
@@ -0,0 +1,38 @@
+Description: Replace date timestamp by SOURCE_DATE_EPOCH env var in xgettext
+Author: Dhole <dhole at openmailbox.org>
+
+---
+
+--- gettext-0.19.4.orig/gettext-tools/src/xgettext.c
++++ gettext-0.19.4/gettext-tools/src/xgettext.c
+@@ -3410,6 +3410,7 @@ construct_header ()
+   message_ty *mp;
+   char *msgstr;
+   char *comment;
++  char *source_date_epoch;
+   static lex_pos_ty pos = { __FILE__, __LINE__ };
+ 
+   if (package_name != NULL)
+@@ -3431,7 +3432,21 @@ the MSGID_BUGS_ADDRESS variable there; o
+ specify an --msgid-bugs-address command line option.\n\
+ ")));
+ 
+-  time (&now);
++  /* Allow the date and time to be set externally by an exported
++     environment variable to enable reproducible builds. */
++  source_date_epoch = getenv ("SOURCE_DATE_EPOCH");
++  if (source_date_epoch)
++    {
++      errno = 0;
++      now = (time_t) strtol (source_date_epoch, NULL, 10);
++      if (errno != 0)
++        error (EXIT_FAILURE, errno, _("\
++SOURCE_DATE_EPOCH=\"%s\" is not a valid number"), source_date_epoch);
++      setenv("TZ", "UTC", 1);
++    }
++  else
++    time (&now);
++
+   timestring = po_strftime (&now);
+ 
+   msgstr = xasprintf ("\
diff --git a/debian/patches/series b/debian/patches/series
index 923247f..e37d52d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01-do-not-use-java-in-urlget
 02-msgfmt-default-little-endian
+03-Replace-timestamp-with-SOURCE_DATE_EPOCH

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



More information about the Reproducible-commits mailing list