aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-10-30 11:24:05 -0700
committerMike McQuaid2013-10-30 11:24:21 -0700
commitd31e069ed333ea634dea7558b1ce4933b478535e (patch)
treea4d9db570f42b863ae44d7899c73fdbd8b2fc9e0 /Library/Homebrew/cmd/update.rb
parent1c5b1d745e4077bdb2425dde06bea6a4800cd6aa (diff)
downloadbrew-d31e069ed333ea634dea7558b1ce4933b478535e.tar.bz2
update: automatically tap migrated formulae.
When a formula is removed from core and installed let's tap it so users can get updates without caring which tap we want to put things in. This should allow us to migrate a lot of things to taps. Closes Homebrew/homebrew#23760.
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
-rw-r--r--Library/Homebrew/cmd/update.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 682c5522a..83e763bdc 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -1,5 +1,6 @@
require 'cmd/tap'
require 'cmd/untap'
+require 'tap_migrations'
module Homebrew extend self
def update
@@ -55,6 +56,16 @@ module Homebrew extend self
Homebrew.unlink_tap_formula(report.removed_tapped_formula)
Homebrew.link_tap_formula(report.new_tapped_formula)
+ # automatically tap any migrated formulae's new tap
+ report.select_formula(:D).each do |f|
+ next unless Formula.factory(f).installed?
+ tap_user, tap_repo = TAP_MIGRATIONS[f].split '/'
+ begin
+ install_tap tap_user, tap_repo
+ rescue AlreadyTappedError => e
+ end
+ end
+
if report.empty?
puts "Already up-to-date."
else