blob: 41f206523e64b05ee23564ed85cfa4c680826f9c [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From 6e1dc610724a7aa8368cbcddf4bbe21cccc0f731 Mon Sep 17 00:00:00 2001
2From: Lucas Kanashiro <kanashiro@debian.org>
3Date: Fri, 1 Nov 2019 15:25:17 -0300
4Subject: [PATCH] Make gemspecs reproducible
Patrick Williams93c203f2021-10-06 16:15:23 -05005
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00006Without an explicit date, they will get the current date and make the
7build unreproducible
Patrick Williams93c203f2021-10-06 16:15:23 -05008
9Upstream-Status: Backport [debian]
Patrick Williams93c203f2021-10-06 16:15:23 -050010---
11 lib/rubygems/specification.rb | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000014diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
15index 0d72cee..eb7bc25 100644
Patrick Williams93c203f2021-10-06 16:15:23 -050016--- a/lib/rubygems/specification.rb
17+++ b/lib/rubygems/specification.rb
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000018@@ -1691,7 +1691,9 @@ class Gem::Specification < Gem::BasicSpecification
19 raise(Gem::InvalidSpecificationException,
20 "invalid date format in specification: #{date.inspect}")
21 end
22- when Time, DateLike then
23+ when Time then
24+ Time.utc(date.utc.year, date.utc.month, date.utc.day)
25+ when DateLike then
26 Time.utc(date.year, date.month, date.day)
27 else
28 TODAY
29--
302.25.1
31