mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
[rubygems/rubygems] Set SOURCE_DATE_EPOCH env var if not provided.
Fixes #2290.
1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined,
2. this commit makes RubyGems set it _persistently_ when not provided.
This combination means that you can build a gem, check the build time,
and use that value to generate a new build -- and then verify they're
the same.
d830d53f59
This commit is contained in:
parent
8436b2717c
commit
508afe2c26
6 changed files with 82 additions and 6 deletions
|
@ -193,7 +193,7 @@ class Gem::Package
|
|||
def initialize(gem, security_policy) # :notnew:
|
||||
@gem = gem
|
||||
|
||||
@build_time = ENV["SOURCE_DATE_EPOCH"] ? Time.at(ENV["SOURCE_DATE_EPOCH"].to_i).utc : Time.now
|
||||
@build_time = Gem.source_date_epoch
|
||||
@checksums = {}
|
||||
@contents = nil
|
||||
@digests = Hash.new { |h, algorithm| h[algorithm] = {} }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue