Replace files atomically when relocating
This commit is contained in:
parent
976bf3f60b
commit
91d31ae1f4
@ -40,13 +40,10 @@ class Keg
|
||||
|
||||
(pkgconfig_files | libtool_files | script_files).each do |file|
|
||||
file.ensure_writable do
|
||||
file.open('rb') do |f|
|
||||
s = f.read
|
||||
s.gsub!(old_cellar, new_cellar)
|
||||
s.gsub!(old_prefix, new_prefix)
|
||||
f.reopen(file, 'wb')
|
||||
f.write(s)
|
||||
end
|
||||
s = file.open("rb", &:read)
|
||||
s.gsub!(old_cellar, new_cellar)
|
||||
s.gsub!(old_prefix, new_prefix)
|
||||
file.atomic_write(s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user