diff options
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 8 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfdoc.c | 26 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfencrypt.c | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/xbb.c | 7 |
4 files changed, 34 insertions, 14 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 293aecb25a9..182ebfd2157 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,11 @@ +2016-05-02 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * pdfdoc.c, xbb.c: Apply the patch by Alexis, + http://tug.org/pipermail/tex-live/2016-May/038339.html + for the support of SOURCE_DATE_EPOCH. + * pdfencrypt.c: Use gmtime instead of localtime if SOURCE_DATE_EPOCH + is given, to be consistent with the patch by Alexis. + 2016-03-07 Karl Berry <karl@tug.org> * man/dvipdfmx.1: .B not .b. diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c index b724789aa9b..3bf163ab4d9 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.c +++ b/Build/source/texk/dvipdfm-x/pdfdoc.c @@ -443,11 +443,14 @@ compute_timezone_offset() time_t gmtoff; now = get_unique_time_if_given(); - if (now == 0) + if (now == 0) { now = time(NULL); - localtime_r(&now, &local); - gmtime_r(&now, &tm); - return (mktime(&local) - mktime(&tm)); + localtime_r(&now, &local); + gmtime_r(&now, &tm); + return (mktime(&local) - mktime(&tm)); + } else { + return(0); + } } #endif /* HAVE_TIMEZONE */ @@ -464,20 +467,23 @@ asn_date (char *date_string) struct tm *bd_time; current_time = get_unique_time_if_given(); - if (current_time == 0) + if (current_time == 0) { time(¤t_time); - bd_time = localtime(¤t_time); + bd_time = localtime(¤t_time); #ifdef HAVE_TM_GMTOFF - tz_offset = bd_time->tm_gmtoff; + tz_offset = bd_time->tm_gmtoff; #else # ifdef HAVE_TIMEZONE - tz_offset = -timezone; + tz_offset = -timezone; # else - tz_offset = compute_timezone_offset(); + tz_offset = compute_timezone_offset(); # endif /* HAVE_TIMEZONE */ #endif /* HAVE_TM_GMTOFF */ - + } else { + bd_time = gmtime(¤t_time); + tz_offset = 0; + } sprintf(date_string, "D:%04d%02d%02d%02d%02d%02d%c%02d'%02d'", bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday, bd_time->tm_hour, bd_time->tm_min, bd_time->tm_sec, diff --git a/Build/source/texk/dvipdfm-x/pdfencrypt.c b/Build/source/texk/dvipdfm-x/pdfencrypt.c index b039be1f50c..1771fff722d 100644 --- a/Build/source/texk/dvipdfm-x/pdfencrypt.c +++ b/Build/source/texk/dvipdfm-x/pdfencrypt.c @@ -127,9 +127,12 @@ pdf_enc_compute_id_string (char *dviname, char *pdfname) date_string = NEW(15, char); current_time = get_unique_time_if_given(); - if (current_time == 0) + if (current_time == 0) { time(¤t_time); - bd_time = localtime(¤t_time); + bd_time = localtime(¤t_time); + } else { + bd_time = gmtime(¤t_time); + } sprintf(date_string, "%04d%02d%02d%02d%02d%02d", bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday, bd_time->tm_hour, bd_time->tm_min, bd_time->tm_sec); diff --git a/Build/source/texk/dvipdfm-x/xbb.c b/Build/source/texk/dvipdfm-x/xbb.c index 96cee108fd4..a15bf6aa14f 100644 --- a/Build/source/texk/dvipdfm-x/xbb.c +++ b/Build/source/texk/dvipdfm-x/xbb.c @@ -95,9 +95,12 @@ static void do_time(FILE *file) struct tm *bd_time; current_time = get_unique_time_if_given(); - if (current_time == 0) + if (current_time == 0) { time(¤t_time); - bd_time = localtime(¤t_time); + bd_time = localtime(¤t_time); + } else { + bd_time = gmtime(¤t_time); + } fprintf(file, "%%%%CreationDate: %s\n", asctime(bd_time)); } |