1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
From f68afc020268828ff52670e5bb50bd888a1b30f1 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Fri, 23 Jun 2023 12:41:29 -0700
Subject: [PATCH 2/2] lib/doc/manpages/make_manpages.py: Use consistent
timestamp when generating manpage.
Support SOURCE_DATE_EPOCH, falling back to current time.
Use numeric date, to avoid locale-specific date rendering.
https://reproducible-builds.org/docs/source-date-epoch/
---
lib/doc/manpages/make_manpages.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/doc/manpages/make_manpages.py b/lib/doc/manpages/make_manpages.py
index 545a4a4..2a74189 100644
--- a/lib/doc/manpages/make_manpages.py
+++ b/lib/doc/manpages/make_manpages.py
@@ -253,7 +253,11 @@ def processRefEntry(refentry, info, preface, seealso, output_dir):
# File header
# .TH airmass 1 "June 7, 2008" "C-Munipack 1.2" "C-Munipack Toolkit"
f.write(".TH "+title+" "+manvol+" ")
- f.write("\"" + time.strftime("%B %d, %Y", time.localtime()) + "\" ")
+ # Support deterministic timestamp for reproducible builds
+ # https://reproducible-builds.org/docs/source-date-epoch/
+ f.write("\"" + time.strftime("%Y-%m-%d",
+ time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH',
+ time.time())))) + "\" ")
f.write("\"version "+version+"\" \""+package+"\"\n")
# Command name
refnamediv = getElement(refentry, "refnamediv")
--
2.39.2
|