File: make-build-reproducible.patch

package info (click to toggle)
node-package-preamble 0.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 96 kB
  • sloc: makefile: 3
file content (18 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Description: make the output reproducible
Author: Chris Lamb <lambt@debian.org>
Bug-Debian: https://bugs.debian.org/935790
Forwarded: not-needed
Reviewed-By: Xavier Guimard <yadd@debian.org>
Last-Update: 2019-08-26

--- a/bin/preamble
+++ b/bin/preamble
@@ -8,7 +8,7 @@
   var json = JSON.parse(text);
   process.stdout.write("// " + (json.homepage || json.name)
       + " Version " + json.version + "."
-      + " Copyright " + (new Date).getFullYear()
+      + " Copyright " + (new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime())).getFullYear()
       + " " + json.author.name + (/\.$/.test(json.author.name) ? "" : ".")
       + os.EOL);
 });