aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-07-31 15:54:03 -0500
committerJack Nagel2014-07-31 15:58:03 -0500
commitb160cc9bb64561f28856864d20ce858cb0c26064 (patch)
treede03048513ea9d8c1e6519e31b2ed7f5de0e7393 /Library/Homebrew/cmd
parent5a94cfc4a34f8ce157922fa017484f1617b37e25 (diff)
downloadbrew-b160cc9bb64561f28856864d20ce858cb0c26064.tar.bz2
Handle tap file renames that remove a file from the formula directory
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/update.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 5e7f34b62..467cc60f6 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -174,16 +174,17 @@ class Updater
if initial_revision && initial_revision != current_revision
diff.each_line do |line|
status, *paths = line.split
+ src, dst = paths.first, paths.last
- next unless File.extname(paths.last) == ".rb"
- next unless File.dirname(paths.last) == formula_directory
+ next unless File.extname(dst) == ".rb"
+ next unless paths.any? { |p| File.dirname(p) == formula_directory }
case status
when "A", "M", "D"
- map[status.to_sym] << repository.join(paths.first)
+ map[status.to_sym] << repository.join(src)
when /^R\d{0,3}/
- map[:D] << repository.join(paths.first)
- map[:A] << repository.join(paths.last)
+ map[:D] << repository.join(src) if File.dirname(src) == formula_directory
+ map[:A] << repository.join(dst) if File.dirname(dst) == formula_directory
end
end
end