public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH is used
@ 2024-02-28 15:54 Christian Franke
  2024-03-10 14:44 ` Jon Turney
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2024-02-28 15:54 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

Found during testing of 'repro-check' patch with getent-2.18.90-5 source 
package.

This patch also removes the requirement to set TZ=UTC before patches are 
generated.

-- 
Regards,
Christian


[-- Attachment #2: 0001-Modify-origsrc-timestamp-in-patch-files-if-SOURCE_DA.patch --]
[-- Type: text/plain, Size: 1145 bytes --]

From 342ff5113499a83b2ffda441ddc80b4952b400f8 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Wed, 28 Feb 2024 16:46:51 +0100
Subject: [PATCH] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH
 is used

Also the timestamp of a file in origsrc directory may be newer than
SOURCE_DATE_EPOCH if modified after unpacking e.g. by a src_*_hook.
---
 lib/pkg_pkg.cygpart | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 756a687c..414ec4b4 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -508,9 +508,9 @@ __pkg_diff() {
 
 	if [ -n "${SOURCE_DATE_EPOCH}" ]
 	then
-		# Ensure that the timestamp comment in the generated patch file is reproducible
+		# Ensure that the timestamp comments in the patch files are reproducible
 		source_date=$(date -d @"${SOURCE_DATE_EPOCH}" -u +'%Y-%m-%d %H:%M:%S.000000000 +0000')
-		sed -b -e  "s|^\(+++ [^\t]*\t\).*\$|\1${source_date}|" \
+		sed -E -b -e "s/^((---|\+\+\+) [^\t]*\t).*\$/\1${source_date}/" \
 			-i ${optional_patchfiles} ${patchdir}/${src_patchfile}
 	fi
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH cygport] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH is used
  2024-02-28 15:54 [PATCH cygport] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH is used Christian Franke
@ 2024-03-10 14:44 ` Jon Turney
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Turney @ 2024-03-10 14:44 UTC (permalink / raw)
  To: Christian Franke; +Cc: cygwin-apps

On 28/02/2024 15:54, Christian Franke via Cygwin-apps wrote:
> Found during testing of 'repro-check' patch with getent-2.18.90-5 source 
> package.
> 
> This patch also removes the requirement to set TZ=UTC before patches are 
> generated.
> 

Applied, but the commentary could stand to be clearer about the issue.

I guess this we now fix both the orig file and modified file timestamps 
in the patch file, as the orig timestamp may also vary.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-10 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 15:54 [PATCH cygport] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH is used Christian Franke
2024-03-10 14:44 ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).