aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/installer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/installer.rb')
-rw-r--r--lib/rubygems/installer.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 4a41891b48..939bc9693d 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -331,8 +331,9 @@ class Gem::Installer
# specifications directory.
def write_spec
- File.open(spec_file, "w") do |file|
+ open spec_file, 'w' do |file|
file.puts spec.to_ruby_for_cache
+ file.fsync rescue nil # for filesystems without fsync(2)
end
end
@@ -773,7 +774,13 @@ EOF
def write_build_info_file
return if @build_args.empty?
- open spec.build_info_file, 'w' do |io|
+ build_info_dir = File.join gem_home, 'build_info'
+
+ FileUtils.mkdir_p build_info_dir
+
+ build_info_file = File.join build_info_dir, "#{spec.full_name}.info"
+
+ open build_info_file, 'w' do |io|
@build_args.each do |arg|
io.puts arg
end