public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] Set TZ=UTC if SOURCE_DATE_EPOCH is used
@ 2024-02-20 10:14 Christian Franke
  2024-02-28 16:07 ` Christian Franke
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2024-02-20 10:14 UTC (permalink / raw)
  To: cygwin-apps

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


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

* Re: [PATCH cygport] Set TZ=UTC if SOURCE_DATE_EPOCH is used
  2024-02-20 10:14 [PATCH cygport] Set TZ=UTC if SOURCE_DATE_EPOCH is used Christian Franke
@ 2024-02-28 16:07 ` Christian Franke
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Franke @ 2024-02-28 16:07 UTC (permalink / raw)
  To: cygwin-apps

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

This would be no longer needed for patch files if "Modify origsrc 
timestamp in patch files if SOURCE_DATE_EPOCH is used" would be applied.

This TZ=UTC patch could possibly be dropped then.


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


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

end of thread, other threads:[~2024-02-28 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 10:14 [PATCH cygport] Set TZ=UTC if SOURCE_DATE_EPOCH is used Christian Franke
2024-02-28 16:07 ` Christian Franke

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).