[PATCH cygport] Set TZ=UTC if SOURCE_DATE_EPOCH is used

Christian Franke Christian.Franke@t-online.de
Tue Feb 20 10:14:36 GMT 2024


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

-------------- next part --------------
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



More information about the Cygwin-apps mailing list