Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
ruby2.1.4671
0011-make-gem-build-reproducible.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0011-make-gem-build-reproducible.patch of Package ruby2.1.4671
From 321c440518070355fcf0e594d29acc9a6a12e71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de> Date: Thu, 16 Mar 2017 16:02:51 +0100 Subject: [PATCH 11/13] 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 0ed6e1b91f..a10bb8e102 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -105,9 +105,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 @@ -177,6 +180,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 e1b38ad6b5..fcd28865a8 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