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] Set TZ=UTC if SOURCE_DATE_EPOCH is used
Date: Tue, 20 Feb 2024 11:14:36 +0100	[thread overview]
Message-ID: <865bc266-247f-677c-7d88-0b909d7cdf4d@t-online.de> (raw)

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

Further tests of 'repro-check' patch revealed that the "origsrc/*" 
timestamps in patch files contain the local timezone offset.

The attached patch is on top of the "Add more checks of 
SOURCE_DATE_EPOCH" patch. It could also be applied independently but 
then requires conflict resolution due to the then missing 'else' branch.

-- 
Regards,
Christian


[-- Attachment #2: 0001-Set-TZ-UTC-if-SOURCE_DATE_EPOCH-is-used.patch --]
[-- Type: text/plain, Size: 771 bytes --]

From e9553d8541f9fb2fd4a4e49a488dfc8511fb9c8e Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Tue, 20 Feb 2024 10:32:52 +0100
Subject: [PATCH] Set TZ=UTC if SOURCE_DATE_EPOCH is used

---
 bin/cygport.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bin/cygport.in b/bin/cygport.in
index 3fe8a52e..2261a5bd 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -517,6 +517,10 @@ then
 		4.6.[6-9]|4.[7-9]*|[5-9]*) ;;
 		*) error "SOURCE_DATE_EPOCH requires peflags 4.6.6 or later"
 	esac
+
+	# Ensure that date and time formatting (e.g. in patch files) is reproducible
+	[ "${TZ}" = "UTC" ] || inform "Using TZ='UTC' instead of TZ='${TZ-(unset)}'"
+	export TZ=UTC
 else
 	inform "SOURCE_DATE_EPOCH is not set"
 fi
-- 
2.43.0


             reply	other threads:[~2024-02-20 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 10:14 Christian Franke [this message]
2024-02-28 16:07 ` Christian Franke

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=865bc266-247f-677c-7d88-0b909d7cdf4d@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).