[Reproducible-commits] [libxslt] 04/05: Replace the SOURCE_DATE_EPOCH patch with the one actually committed upstream
Mattia Rizzolo
mattia at debian.org
Fri May 20 12:44:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository libxslt.
commit bc712033ed118d6a8a283da82c8dc59b668ed545
Author: Mattia Rizzolo <mattia at debian.org>
Date: Fri May 20 09:32:28 2016 +0000
Replace the SOURCE_DATE_EPOCH patch with the one actually committed upstream
---
.../0010-Replace-timestamp-with-SOURCE_DATE_EPOCH | 108 ++++++++++++++++-----
1 file changed, 82 insertions(+), 26 deletions(-)
diff --git a/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH b/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH
index 7965775..797d1f5 100644
--- a/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH
+++ b/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH
@@ -1,59 +1,105 @@
Description: Replace date timestamp by SOURCE_DATE_EPOCH env var
-Author: Dhole <dhole at openmailbox.org>
-Forwarded: yes
+Authors: Dhole <dhole at openmailbox.org>, Daniel Veillard <veillard at redhat.com>
+Origin: upstream,
+ https://git.gnome.org/browse/libxslt/commit/?id=8f9303f3b2a73523767b158f9be8dbf2a89ba3a2
+ https://git.gnome.org/browse/libxslt/commit/?id=e57df303eca25a2a3f9e0625c29f4b20177858cc
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=758148
Bug-Debian: https://bugs.debian.org/791815
+Last-Update: 2016-05-20
---
-
---- libxslt-1.1.28.orig/libexslt/date.c
-+++ libxslt-1.1.28/libexslt/date.c
-@@ -46,6 +46,7 @@
- #include "exslt.h"
+--- a/config.h.in
++++ b/config.h.in
+@@ -12,6 +12,9 @@
+ /* Define to 1 if you have the <dlfcn.h> header file. */
+ #undef HAVE_DLFCN_H
+
++/* Define to 1 if you have the <errno.h> header file. */
++#undef HAVE_ERRNO_H
++
+ /* Define if fabs is there */
+ #undef HAVE_FABS
+
+@@ -147,8 +150,7 @@
+ /* Define to 1 if you have the `_stat' function. */
+ #undef HAVE__STAT
+
+-/* Define to the sub-directory in which libtool stores uninstalled libraries.
+- */
++/* Define to the sub-directory where libtool stores uninstalled libraries. */
+ #undef LT_OBJDIR
+
+ /* Name of package */
+--- a/configure.in
++++ b/configure.in
+@@ -235,6 +235,7 @@
+
+ AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h)
+ AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
++AC_CHECK_HEADERS(errno.h)
+ AC_CHECK_FUNCS(stat _stat)
+ AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
+ [M_LIBS="-lm"; AC_DEFINE([HAVE_POW],[], [Define if pow is there])]))
+--- a/libexslt/date.c
++++ b/libexslt/date.c
+@@ -47,6 +47,9 @@
#include <string.h>
-+#include <errno.h>
++#ifdef HAVE_ERRNO_H
++#include <errno.h>
++#endif
#ifdef HAVE_MATH_H
#include <math.h>
-@@ -747,21 +748,46 @@ static exsltDateValPtr
+ #endif
+@@ -747,21 +750,55 @@
exsltDateCurrent (void)
{
struct tm localTm, gmTm;
++#ifndef HAVE_GMTIME_R
+ struct tm *tb = NULL;
++#endif
time_t secs;
int local_s, gm_s;
exsltDateValPtr ret;
++#ifdef HAVE_ERRNO_H
+ char *source_date_epoch;
++#endif /* HAVE_ERRNO_H */
++ int override = 0;
ret = exsltDateCreateDate(XS_DATETIME);
if (ret == NULL)
return NULL;
-- /* get current time */
- secs = time(NULL);
-+ /*
++#ifdef HAVE_ERRNO_H
++ /*
+ * Allow the date and time to be set externally by an exported
-+ * environment variable to enable reproducible builds.
++ * environment variable to enable reproducible builds.
+ */
+ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
-+ errno = 0;
++ errno = 0;
+ secs = (time_t) strtol (source_date_epoch, NULL, 10);
+ if (errno == 0) {
++#if HAVE_GMTIME_R
++ if (gmtime_r(&secs, &localTm) != NULL)
++ override = 1;
++#else
+ tb = gmtime(&secs);
-+ if (tb == NULL) {
-+ /* SOURCE_DATE_EPOCH is not a valid date */
-+ return NULL;
-+ } else {
-+ localTm = *tb;
++ if (tb != NULL) {
++ localTm = *tb;
++ override = 1;
+ }
-+ } else {
-+ /* SOURCE_DATE_EPOCH is not a valid number */
-+ return NULL;
-+ }
-+ } else {
-+ /* get current time */
++#endif
++ }
++ }
++#endif /* HAVE_ERRNO_H */
++
++ if (override == 0) {
+ /* get current time */
+- secs = time(NULL);
++ secs = time(NULL);
++
#if HAVE_LOCALTIME_R
- localtime_r(&secs, &localTm);
+ localtime_r(&secs, &localTm);
@@ -62,7 +108,17 @@ Bug-Debian: https://bugs.debian.org/791815
+ localTm = *localtime(&secs);
#endif
+ }
-+
/* get real year, not years since 1900 */
ret->value.date.year = localTm.tm_year + 1900;
+@@ -778,7 +815,9 @@
+ #if HAVE_GMTIME_R
+ gmtime_r(&secs, &gmTm);
+ #else
+- gmTm = *gmtime(&secs);
++ tb = gmtime(&secs);
++ if (tb != NULL)
++ gmTm = *tb;
+ #endif
+ ret->value.date.tz_flag = 0;
+ #if 0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/libxslt.git
More information about the Reproducible-commits
mailing list