Bug#867753: grunt: please make the output reproducible

2017-09-14 Thread Chris Lamb
Hi,

> grunt: please make the output reproducible

Any chance of applying this in Debian? :)  It's now making
src:searx not-reproducible (as well as src:jquery-tablesorter:)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#867753: grunt: please make the output reproducible

2017-07-09 Thread Chris Lamb
forwarded 867753 https://github.com/gruntjs/grunt/pull/1596
thanks

Forwarded upstream here:

  https://github.com/gruntjs/grunt/pull/1596


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb, Debian Project Leader
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#867753: grunt: please make the output reproducible

2017-07-09 Thread Chris Lamb
Source: grunt
Version: 1.0.1-5
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 grunt can generate non-reproducible output.

This is affecting the reproducibility status other packages such as
libjquery-tablesorter that set a "pkg.banner" such as:

  <%= grunt.template.today("mm-dd-")


Patch attached.

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


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb, Debian Project Leader
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
diff --git a/lib/grunt/template.js b/lib/grunt/template.js
index d1967df..15e1fe1 100644
--- a/lib/grunt/template.js
+++ b/lib/grunt/template.js
@@ -10,7 +10,11 @@ template.date = require('dateformat');
 
 // Format today's date.
 template.today = function(format) {
-  return template.date(new Date(), format);
+  var now = new Date();
+  if (process.env.SOURCE_DATE_EPOCH) {
+now = new Date((process.env.SOURCE_DATE_EPOCH * 1000) + 
(now.getTimezoneOffset() * 6));
+  }
+  return template.date(now, format);
 };
 
 // Template delimiters.