summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch
blob: 24268625a282ea1fbafb6081eafe154ad6dd2eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 3bc324379aa3e322bad9353da8c0064cd671cc74 Mon Sep 17 00:00:00 2001
From: Lucas Kanashiro <kanashiro@debian.org>
Date: Fri, 1 Nov 2019 15:25:17 -0300
Subject: [PATCH] Make gemspecs reproducible

Without an explicit date, they will get the current date and make the
build unreproducible

Upstream-Status: Backport [debian]
---
 lib/rubygems/specification.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index a0c7faa..f0722d9 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1774,7 +1774,9 @@ class Gem::Specification < Gem::BasicSpecification
                 raise(Gem::InvalidSpecificationException,
                       "invalid date format in specification: #{date.inspect}")
               end
-            when Time, DateLike then
+            when Time then
+              Time.utc(date.utc.year, date.utc.month, date.utc.day)
+            when DateLike then
               Time.utc(date.year, date.month, date.day)
             else
               TODAY
-- 
2.39.2