Only write files if we actually made a change
This commit is contained in:
parent
4e918666d7
commit
b25156ca4a
@ -42,12 +42,15 @@ class Keg
|
||||
|
||||
files.group_by { |f| f.stat.ino }.each_value do |first, *rest|
|
||||
s = first.open("rb", &:read)
|
||||
s.gsub!(old_cellar, new_cellar)
|
||||
s.gsub!(old_prefix, new_prefix)
|
||||
changed = s.gsub!(old_cellar, new_cellar)
|
||||
changed = s.gsub!(old_prefix, new_prefix) || changed
|
||||
|
||||
if changed
|
||||
first.atomic_write(s)
|
||||
rest.each { |file| FileUtils.ln(first, file, :force => true) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def change_dylib_id(id, file)
|
||||
puts "Changing dylib ID in #{file} to #{id}" if ARGV.debug?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user