aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 7939136a5..aacd68fc5 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -1,4 +1,5 @@
require 'cmd/tap'
+require 'cmd/untap'
module Homebrew extend self
@@ -26,6 +27,9 @@ module Homebrew extend self
end
end
end
+
+ # we unlink first in case the formula has moved to another tap
+ Homebrew.unlink_tap_formula(report.removed_tapped_formula)
Homebrew.link_tap_formula(report.new_tapped_formula)
if report.empty?
@@ -121,19 +125,27 @@ class Report < Hash
# dump_deleted_commands
end
- def new_tapped_formula
- fetch(:A, []).map do |path|
- case path when %r{^Library/Taps(/\w+-\w+/.*)}
+ def tapped_formula_for key
+ fetch(key, []).map do |path|
+ case path when %r{^Library/Taps/(\w+-\w+/.*)}
Pathname.new($1)
end
end.compact
end
+ def new_tapped_formula
+ tapped_formula_for :A
+ end
+
+ def removed_tapped_formula
+ tapped_formula_for :D
+ end
+
def select_formula key
fetch(key, []).map do |path|
case path when %r{^Library/Formula}
File.basename(path, ".rb")
- when %r{^Library/Taps/(\w+)-(\w+)/(.*)}
+ when %r{^Library/Taps/(\w+)-(\w+)/(.*)\.rb}
"#$1/#$2/#{File.basename(path, '.rb')}"
end
end.compact.sort