summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/ruby/ruby/0005-Mark-Gemspec-reproducible-change-fixing-784225-too.patch
blob: 41f206523e64b05ee23564ed85cfa4c680826f9c (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 6e1dc610724a7aa8368cbcddf4bbe21cccc0f731 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 0d72cee..eb7bc25 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1691,7 +1691,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.25.1