public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-apps@cygwin.com
Subject: [PATCH cygport] Modify origsrc timestamp in patch files if SOURCE_DATE_EPOCH is used
Date: Wed, 28 Feb 2024 16:54:47 +0100	[thread overview]
Message-ID: <ea39310b-928f-c1f6-0f0a-6c8da499d660@t-online.de> (raw)

[-- 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


             reply	other threads:[~2024-02-28 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 15:54 Christian Franke [this message]
2024-03-10 14:44 ` Jon Turney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea39310b-928f-c1f6-0f0a-6c8da499d660@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).