Source: node-package-preamble
Version: 0.1.0-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed
that node-package-preamble generates unreproducible output.

This is causing a number of packages to fail to build reproducibly,
such as node-d3-scale etc.:

│ │ │ ├── ./usr/share/nodejs/d3-scale/build/d3-scale.js
│ │ │ │ ├── js-beautify {}
│ │ │ │ │ @@ -1,8 +1,8 @@
│ │ │ │ │ -// https://d3js.org/d3-scale/ Version 1.0.7. Copyright 2019 Mike 
Bostock.
│ │ │ │ │ +// https://d3js.org/d3-scale/ Version 1.0.7. Copyright 2020 Mike 
Bostock.

Patch attached.

  [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/bin/preamble b/bin/preamble
index a563140..9bea3eb 100755
--- a/bin/preamble
+++ b/bin/preamble
@@ -8,7 +8,7 @@ fs.readFile("package.json", "utf8", function(error, text) {
   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);
 });
-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to