File: Reproducible-build.patch

package info (click to toggle)
python-gvm 26.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,132 kB
  • sloc: python: 44,662; makefile: 18
file content (40 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
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
36
37
38
39
40
From: Chris Lamb <lamby@debian.org>
Date: Wed, 28 Aug 2024 14:46:35 +0200
Subject: Make the build reproducible

Last-Update: 2024-04-25
---
 docs/conf.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 2618e58..c4f4386 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -16,7 +16,13 @@
 
 import os
 import sys
-from datetime import datetime
+import time
+import datetime
+
+build_date = datetime.datetime.fromtimestamp(
+    int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
+    tz=datetime.timezone.utc,
+)
 
 sys.path.insert(0, os.path.abspath(".."))
 
@@ -24,10 +30,8 @@ import gvm  # noqa: E402
 
 # -- Project information -----------------------------------------------------
 
-year = datetime.now().year
-
 project = "python-gvm"
-copyright = f"2018 - {year}, Greenbone AG"
+copyright = f"2018 - {build_date.year}, Greenbone AG"
 author = "Greenbone AG"
 
 # The short X.Y version