Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 1 | From 3bc324379aa3e322bad9353da8c0064cd671cc74 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 2 | From: Lucas Kanashiro <kanashiro@debian.org> |
| 3 | Date: Fri, 1 Nov 2019 15:25:17 -0300 |
| 4 | Subject: [PATCH] Make gemspecs reproducible |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 5 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 6 | Without an explicit date, they will get the current date and make the |
| 7 | build unreproducible |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 8 | |
| 9 | Upstream-Status: Backport [debian] |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 10 | --- |
| 11 | lib/rubygems/specification.rb | 4 +++- |
| 12 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 13 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 14 | diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 15 | index a0c7faa..f0722d9 100644 |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 16 | --- a/lib/rubygems/specification.rb |
| 17 | +++ b/lib/rubygems/specification.rb |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 18 | @@ -1774,7 +1774,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 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 29 | -- |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame^] | 30 | 2.39.2 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 31 | |