ruby-changes:54341
From: nobu <ko1@a...>
Date: Tue, 25 Dec 2018 22:33:56 +0900 (JST)
Subject: [ruby-changes:54341] nobu:r66554 (trunk): Restore SOURCE_DATE_EPOCH
nobu 2018-12-25 22:33:51 +0900 (Tue, 25 Dec 2018) New Revision: 66554 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66554 Log: Restore SOURCE_DATE_EPOCH Modified files: trunk/test/rubygems/test_gem_package.rb trunk/test/rubygems/test_gem_package_tar_writer.rb trunk/test/rubygems/test_gem_specification.rb Index: test/rubygems/test_gem_package.rb =================================================================== --- test/rubygems/test_gem_package.rb (revision 66553) +++ test/rubygems/test_gem_package.rb (revision 66554) @@ -105,6 +105,7 @@ class TestGemPackage < Gem::Package::Tar https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L105 end def test_build_time_source_date_epoch + epoch = ENV["SOURCE_DATE_EPOCH"] ENV["SOURCE_DATE_EPOCH"] = "123456789" spec = Gem::Specification.new 'build', '1' @@ -118,6 +119,8 @@ class TestGemPackage < Gem::Package::Tar https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L119 package = Gem::Package.new spec.file_name assert_equal Time.at(ENV["SOURCE_DATE_EPOCH"].to_i).utc, package.build_time + ensure + ENV["SOURCE_DATE_EPOCH"] = epoch end def test_add_files Index: test/rubygems/test_gem_package_tar_writer.rb =================================================================== --- test/rubygems/test_gem_package_tar_writer.rb (revision 66553) +++ test/rubygems/test_gem_package_tar_writer.rb (revision 66554) @@ -11,9 +11,12 @@ class TestGemPackageTarWriter < Gem::Pac https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package_tar_writer.rb#L11 @data = 'abcde12345' @io = TempIO.new @tar_writer = Gem::Package::TarWriter.new @io + @epoch = ENV["SOURCE_DATE_EPOCH"] + ENV["SOURCE_DATE_EPOCH"] = nil end def teardown + ENV["SOURCE_DATE_EPOCH"] = @epoch @tar_writer.close unless @tar_writer.closed? @io.close! Index: test/rubygems/test_gem_specification.rb =================================================================== --- test/rubygems/test_gem_specification.rb (revision 66553) +++ test/rubygems/test_gem_specification.rb (revision 66554) @@ -1719,8 +1719,11 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1719 end def test_date_use_env_source_date_epoch + epoch = ENV["SOURCE_DATE_EPOCH"] ENV["SOURCE_DATE_EPOCH"] = "123456789" assert_equal Time.utc(1973,11,29,0,0,0), @a1.date + ensure + ENV["SOURCE_DATE_EPOCH"] = epoch end def test_dependencies -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/