[Pkg-javascript-devel] Bug#868321: node-marked-man: please make the output reproducible

Chris Lamb lamby at debian.org
Fri Jul 14 13:31:54 UTC 2017


Source: node-marked-man
Version: 0.2.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that node-marked-man generated reproducible output. In particular,
it uses the current timestamp which varies between builds.

Patch attached that uses SOURCE_DATE_EPOCH[1] if that is exported
in the environment.

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb, Debian Project Leader
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/lib/marked-man.js b/lib/marked-man.js
index 71e58d2..e34d089 100644
--- a/lib/marked-man.js
+++ b/lib/marked-man.js
@@ -414,6 +414,9 @@ function rparseHeader(str, options) {
 }
 function manDate(date) {
   date = new Date(date);
+  if (process.env.SOURCE_DATE_EPOCH) {
+    date = new Date(process.env.SOURCE_DATE_EPOCH * 1000);
+  }
   var month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][date.getMonth()];
   return month + " " + date.getFullYear();
 }


More information about the Pkg-javascript-devel mailing list