aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-08-20 20:12:02 +0800
committerXu Cheng2015-08-20 20:12:02 +0800
commit62d1636144d40b7f80f36887bb25bf43f7d42981 (patch)
tree8f4668d5fd5146afd7be52b7652508a4220b8932 /Library
parent35ef2bc132e14733fbf6c4542612020a0be648eb (diff)
downloadbrew-62d1636144d40b7f80f36887bb25bf43f7d42981.tar.bz2
update: only update renamed when necessary
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 398aca6f5..d9cecf5d5 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -318,7 +318,7 @@ class Report
end
def update_renamed
- @hash[:R] ||= []
+ renamed_formulae = []
fetch(:D, []).each do |path|
case path.to_s
@@ -333,12 +333,15 @@ class Report
end
if fetch(:A, []).include?(newpath = path.dirname.join("#{newname}.rb"))
- @hash[:R] << [path, newpath]
+ renamed_formulae << [path, newpath]
end
end
- @hash[:A] -= @hash[:R].map(&:last) if @hash[:A]
- @hash[:D] -= @hash[:R].map(&:first) if @hash[:D]
+ unless renamed_formulae.empty?
+ @hash[:A] -= renamed_formulae.map(&:last) if @hash[:A]
+ @hash[:D] -= renamed_formulae.map(&:first) if @hash[:D]
+ @hash[:R] = renamed_formulae
+ end
end
def select_formula(key)