File: 0003_reproducible-build.patch

package info (click to toggle)
openvpn3-client 24.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 19,384 kB
  • sloc: cpp: 180,128; python: 11,591; ansic: 1,878; sh: 1,767; java: 402; lisp: 81; makefile: 44
file content (55 lines) | stat: -rw-r--r-- 1,816 bytes parent folder | download | duplicates (2)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Make the build reproducible
Author: Chris Lamb <lamby@debian.org>
Last-Update: 2025-04-21

--- openvpn3-client-24+dfsg.orig/src/python/openvpn3/gen-python-constants.cpp
+++ openvpn3-client-24+dfsg/src/python/openvpn3/gen-python-constants.cpp
@@ -29,6 +29,8 @@
 #include "netcfg/netcfg-changetype.hpp"
 #include "sessionmgr/sessionmgr-events.hpp"
 
+#include <openvpn/common/path.hpp>
+
 
 enum class FlagType
 {
@@ -117,7 +119,7 @@ int main(int argc, char **argv)
 {
 
     std::cout << "#" << std::endl
-              << "# Generated by " << argv[0] << std::endl
+              << "# Generated by " << openvpn::path::basename(argv[0]) << std::endl
               << "# as part of the project build." << std::endl
               << "#" << std::endl
               << "# This file is part of openvpn3-linux, licensed" << std::endl
--- openvpn3-client-24+dfsg.orig/src/shell/bash-completion/gen-openvpn2-completion.py
+++ openvpn3-client-24+dfsg/src/shell/bash-completion/gen-openvpn2-completion.py
@@ -17,9 +17,12 @@
 import importlib
 import sys
 import argparse
-from datetime import date
+import os
+import time
+import datetime
 from jinja2 import Template
 
+
 completion_template = """#  OpenVPN 3 Linux client -- Next generation OpenVPN client
 #
 #  SPDX-License-Identifier: AGPL-3.0-only
@@ -122,8 +125,13 @@ if __name__ == '__main__':
         else:
             valid_args[opt] = '%s' % values[0]
 
+    build_date = datetime.datetime.fromtimestamp(
+        int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
+        tz=datetime.timezone.utc,
+    )
+
     ctpl = Template(completion_template)
     script = ctpl.render(valid_args=valid_args, option_list=option_list,
-                         year=date.today().year)
+                         year=build_date.year)
 
     print(script)