Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghostscript for openSUSE:Factory checked in at 2025-02-07 22:56:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghostscript (Old) and /work/SRC/openSUSE:Factory/.ghostscript.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghostscript" Fri Feb 7 22:56:34 2025 rev:70 rq:1243309 version:10.04.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghostscript/ghostscript.changes 2024-10-31 16:08:44.449495004 +0100 +++ /work/SRC/openSUSE:Factory/.ghostscript.new.2316/ghostscript.changes 2025-02-07 22:58:49.850409389 +0100 @@ -1,0 +2,7 @@ +Tue Feb 4 09:42:47 UTC 2025 - Bernhard Wiedemann <bwiedem...@suse.com> + +- Add reproducible.patch to not embed timestamp in .h file +- Add 2010_add_build_timestamp_setting.patch to allow overriding + timestamp in generated pdf (boo#1236773) + +------------------------------------------------------------------- New: ---- 2010_add_build_timestamp_setting.patch reproducible.patch BETA DEBUG BEGIN: New:- Add reproducible.patch to not embed timestamp in .h file - Add 2010_add_build_timestamp_setting.patch to allow overriding timestamp in generated pdf (boo#1236773) New: - Add reproducible.patch to not embed timestamp in .h file - Add 2010_add_build_timestamp_setting.patch to allow overriding BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghostscript.spec ++++++ --- /var/tmp/diff_new_pack.MeRMIU/_old 2025-02-07 22:58:51.010457251 +0100 +++ /var/tmp/diff_new_pack.MeRMIU/_new 2025-02-07 22:58:51.014457417 +0100 @@ -48,6 +48,8 @@ # Patch101 ijs_exec_server_dont_use_sh.patch fixes IJS printing problem # additionally allow exec'ing hpijs in apparmor profile was needed (bsc#1128467): Patch101: ijs_exec_server_dont_use_sh.patch +Patch102: reproducible.patch +Patch103: 2010_add_build_timestamp_setting.patch # Build Requirements: BuildRequires: freetype2-devel BuildRequires: libjpeg-devel @@ -170,6 +172,8 @@ %if 0%{?suse_version} >= 1550 rm -rf openjpeg %endif +%patch -P102 -p1 +%patch -P103 -p1 %build # Derive build timestamp from latest changelog entry ++++++ 2010_add_build_timestamp_setting.patch ++++++ Description: Allow the build timestamp to be externally set In order to make Ghostscript output reproducible, we need a way to set the build timestamp to other values than the current time. We now consistently use gp_get_realtime() instead of directly calling time() or gp_get_usertime() and make gp_get_realtime() use the value found in the SOURCE_DATE_EPOCH environment variable if set. Also, environment timezone is fixed to UTC if SOURCE_DATE_EPOCH is used to avoid variations. Author: Eduard Sanou <dh...@openmailbox.org> Author: Peter De Wachter <pdewa...@gmail.com> Bug-Debian: https://bugs.debian.org/794004 Forwarded: not-needed Last-Update: 2023-09-13 --- This patch header follows DEP-3: https://dep.debian.net/deps/dep3/ --- a/base/gp_unix.c +++ b/base/gp_unix.c @@ -19,6 +19,7 @@ #ifdef __MINGW32__ # include "windows_.h" #endif +#include "errno_.h" #include "pipe_.h" #include "string_.h" #include "time_.h" @@ -149,6 +150,7 @@ gp_get_realtime(long *pdt) { struct timeval tp; + const char *env; #if gettimeofday_no_timezone /* older versions of SVR4 */ { @@ -168,6 +170,26 @@ } #endif + env = getenv("SOURCE_DATE_EPOCH"); + if (env) { + char *end; + long timestamp; + + errno = 0; + timestamp = strtol(env, &end, 10); + if (env == end || *end || errno != 0) { + lprintf("Ghostscript: SOURCE_DATE_EPOCH is not a number!\n"); + timestamp = 0; + } + + tp.tv_sec = timestamp; + tp.tv_usec = 0; + + /* We need to fix the environment timezone to get reproducible */ + /* results when parsing the result of gp_get_realtime. */ + setenv("TZ", "UTC", 1); + } + /* tp.tv_sec is #secs since Jan 1, 1970 */ pdt[0] = tp.tv_sec; --- a/devices/vector/gdevpdf.c +++ b/devices/vector/gdevpdf.c @@ -437,6 +437,7 @@ if (!pdev->OmitInfoDate) { struct tm tms; + long secs_ns[2]; time_t t; char buf[1+2+4+2+2+2+2+2+1+2+1+2+1+1+1]; /* (D:yyyymmddhhmmssZhh'mm')\0 */ int timeoffset; @@ -448,7 +449,8 @@ timesign = 'Z'; timeoffset = 0; #else - time(&t); + gp_get_realtime(secs_ns); + t = secs_ns[0]; tms = *gmtime(&t); tms.tm_isdst = -1; timeoffset = (int)difftime(t, mktime(&tms)); /* tz+dst in seconds */ --- a/devices/vector/gdevpdfe.c +++ b/devices/vector/gdevpdfe.c @@ -216,6 +216,7 @@ { /* We don't write a day time because we don't have a time zone. */ struct tm tms; + long secs_ns[2]; time_t t; char buf1[4+1+2+1+2+1]; /* yyyy-mm-dd\0 */ @@ -223,7 +224,8 @@ memset(&t, 0, sizeof(t)); memset(&tms, 0, sizeof(tms)); #else - time(&t); + gp_get_realtime(secs_ns); + t = secs_ns[0]; tms = *localtime(&t); #endif gs_snprintf(buf1, sizeof(buf1), --- a/devices/vector/gdevpsu.c +++ b/devices/vector/gdevpsu.c @@ -187,6 +187,7 @@ dev->dname); #endif { + long secs_ns[2]; time_t t; struct tm tms; @@ -194,7 +195,8 @@ memset(&t, 0, sizeof(t)); memset(&tms, 0, sizeof(tms)); #else - time(&t); + gp_get_realtime(secs_ns); + t = secs_ns[0]; tms = *localtime(&t); #endif fprintf(f, "%%%%CreationDate: %d/%02d/%02d %02d:%02d:%02d\n", ++++++ reproducible.patch ++++++ Date: 2024-09-20 Author: Bernhard M. Wiedemann <bwiedemann suse de> Drop build date from generated .h file so that openSUSE's ghostscript-debugsource package does not vary between builds. Index: ghostscript-10.03.1/base/pack_ps.c =================================================================== --- ghostscript-10.03.1.orig/base/pack_ps.c +++ ghostscript-10.03.1/base/pack_ps.c @@ -344,7 +344,7 @@ main(int argc, char *argv[]) if (!buildtime) { buildtime = time(NULL); } - fprintf(outfile,"/* Auto-generated from PostScript file \"%s\" at time %ld */\n", infilename, (long)buildtime); + fprintf(outfile,"/* Auto-generated from PostScript file \"%s\" */\n", infilename); while (readline(infile, inputline, INPUT_LINE_LENGTH_MAX)) {