aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2013-10-30 11:24:05 -0700
committerMike McQuaid2013-10-30 11:24:21 -0700
commit0c96d78966b1c3a46096cf0b60d9129c6bf82f37 (patch)
tree658cf5bf30dec021c7b928924afea810fde5d8fc /Library
parentff33f2e575623b86ed51c47ef4d235ce992bc0db (diff)
downloadhomebrew-0c96d78966b1c3a46096cf0b60d9129c6bf82f37.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 #23760.
Diffstat (limited to 'Library')
-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