[Pkg-javascript-devel] Bug#892425: node-package-preamble: please make the output reproducible

Ben Finney bignose at debian.org
Fri Mar 9 02:34:28 UTC 2018


Chris Lamb <lamby at debian.org> writes:

> diff --git a/bin/preamble b/bin/preamble
> index a563140..be96d96 100755
> --- a/bin/preamble
> +++ b/bin/preamble
> @@ -3,12 +3,17 @@
>  var os = require("os"),
>      fs = require("fs");
>  
> +var now = new Date();
> +if (process.env.SOURCE_DATE_EPOCH) {
> +  now = new Date((process.env.SOURCE_DATE_EPOCH * 1000) + (now.getTimezoneOffset() * 60000));
> +}
> +
>  fs.readFile("package.json", "utf8", function(error, text) {
>    if (error) throw error;
>    var json = JSON.parse(text);
>    process.stdout.write("// " + (json.homepage || json.name)
>        + " Version " + json.version + "."
> -      + " Copyright " + (new Date).getFullYear()
> +      + " Copyright " + now.getFullYear()
>        + " " + json.author.name + (/\.$/.test(json.author.name) ? "" : ".")
>        + os.EOL);
>  });

Is this change generally useful to recipients of the upstream code base?
Or is it specific to OS distributions?

Does this constitute an improvement to the upstream code base? Or should
remain a persistent patch in the Debian package?

Does this change apply more generally to many JavaScript packages?

-- 
 \           “I prayed for twenty years but received no answer until I |
  `\          prayed with my legs.” —Frederick Douglass, escaped slave |
_o__)                                                                  |
Ben Finney <bignose at debian.org>



More information about the Pkg-javascript-devel mailing list