Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
ruby2.2
0002-make-gem-build-reproducible.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-make-gem-build-reproducible.patch of Package ruby2.2
From e955cdc91a10ee969e7400e4ebcb24c8b75b953e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Wed, 8 Mar 2017 17:56:58 +0100 Subject: [PATCH 2/5] make gem build reproducible --- lib/rubygems/package.rb | 4 ++++ lib/rubygems/package/tar_writer.rb | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index e8b8b38b06..b5a876c1be 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -108,9 +108,12 @@ class Gem::Package def self.build spec, skip_validation=false gem_file = spec.file_name + spec_file = spec.loaded_from + spec_file = "Gemfile" if spec_file.nil? || spec_file.empty? package = new gem_file package.spec = spec + package.build_time = File.stat(spec_file).mtime.to_i package.build skip_validation gem_file @@ -187,6 +190,7 @@ class Gem::Package digests = tar.add_file_signed 'data.tar.gz', 0444, @signer do |io| gzip_to io do |gz_io| Gem::Package::TarWriter.new gz_io do |data_tar| + data_tar.mtime = @build_time add_files data_tar end end diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index dfd635724b..3a49cf7f81 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -90,12 +90,15 @@ class Gem::Package::TarWriter nil end + attr_accessor :mtime + ## # Creates a new TarWriter that will write to +io+ def initialize(io) @io = io @closed = false + @mtime = Time.now end ## @@ -124,7 +127,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new :name => name, :mode => mode, :size => size, :prefix => prefix, - :mtime => Time.now + :mtime => mtime @io.write header @io.pos = final_pos @@ -217,7 +220,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new(:name => name, :mode => mode, :size => size, :prefix => prefix, - :mtime => Time.now).to_s + :mtime => mtime).to_s @io.write header os = BoundedStream.new @io, size @@ -279,7 +282,7 @@ class Gem::Package::TarWriter header = Gem::Package::TarHeader.new :name => name, :mode => mode, :typeflag => "5", :size => 0, :prefix => prefix, - :mtime => Time.now + :mtime => mtime @io.write header -- 2.12.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor