|
0 |
This patch is a tweaked version of the git commit
|
|
1 |
707484790e63359d2216a05a8ae8750ed5af304b by JojoBoulix <pagth@passoire.fr>
|
|
2 |
|
|
3 |
Honour the SOURCE_DATE_EPOCH environment variable
|
|
4 |
|
|
5 |
When the environment variable SOURCE_DATE_EPOCH is set, use it as the epoch of
|
|
6 |
the date to be written in the output. This allows to build reproducibly
|
|
7 |
packages depending on LDoc to build their documentation, without any change to
|
|
8 |
their code and build process.
|
|
9 |
|
|
10 |
See https://reproducible-builds.org/specs/source-date-epoch/
|
|
11 |
|
|
12 |
Index: lua-ldoc-1.4.3/ldoc.lua
|
|
13 |
===================================================================
|
|
14 |
--- lua-ldoc-1.4.3.orig/ldoc.lua
|
|
15 |
+++ lua-ldoc-1.4.3/ldoc.lua
|
|
16 |
@@ -783,10 +783,14 @@ ldoc.modules = module_list
|
|
17 |
ldoc.title = ldoc.title or args.title
|
|
18 |
ldoc.project = ldoc.project or args.project
|
|
19 |
ldoc.package = args.package:match '%a+' and args.package or nil
|
|
20 |
-if args.date == 'system' then
|
|
21 |
-ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")
|
|
22 |
+if os.getenv("SOURCE_DATE_EPOCH") == nil then
|
|
23 |
+ if args.date == 'system' then
|
|
24 |
+ ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")
|
|
25 |
+ else
|
|
26 |
+ ldoc.updatetime = args.date
|
|
27 |
+ end
|
|
28 |
else
|
|
29 |
-ldoc.updatetime = args.date
|
|
30 |
+ ldoc.updatetime = os.date("!%Y-%m-%d %H:%M:%S",os.getenv("SOURCE_DATE_EPOCH"))
|
|
31 |
end
|
|
32 |
|
|
33 |
local html = require 'ldoc.html'
|