From 6071e3b54cf0ad2309fb7d5238c3557c724f415a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 2 Dec 2013 16:14:43 -0600 Subject: [PATCH] Fix tap migrations When a `brew update` pulls down additions to tap_migrations.rb and the removed formulae in the same update, the migrations will never run, because tap_migrations.rb is loaded before the update takes place. Fix this by loading it after the update. --- Library/Homebrew/cmd/update.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 68298fd523..f6e90f6c9e 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -1,6 +1,5 @@ require 'cmd/tap' require 'cmd/untap' -require 'tap_migrations' module Homebrew extend self def update @@ -66,7 +65,7 @@ module Homebrew extend self install_tap tap_user, tap_repo rescue AlreadyTappedError => e end - end + end if load_tap_migrations if report.empty? puts "Already up-to-date." @@ -91,6 +90,11 @@ module Homebrew extend self raise end + def load_tap_migrations + require 'tap_migrations' + rescue LoadError + false + end end class Updater