aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-09-24 19:39:04 +0100
committerMike McQuaid2013-09-24 23:06:10 +0100
commite82636d17e44b615cc16d497ea378b2d1417df84 (patch)
treedc6a8298ea5186dcf7616249807fafac031f118f /Library/Homebrew/cmd/update.rb
parent88c3a7157e03a85daaacd0ef8f4fe1244db4a869 (diff)
downloadhomebrew-e82636d17e44b615cc16d497ea378b2d1417df84.tar.bz2
update: untap/retap formulae before/after pull.
This should fix problems like #19799 where we pull formulae from taps into core. I want to get something similar merged ASAP so we can pull GCC into core (see #20678). Closes #19799.
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
-rw-r--r--Library/Homebrew/cmd/update.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 09e68f688..b1cb5d967 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -17,9 +17,21 @@ module Homebrew extend self
cd HOMEBREW_REPOSITORY
git_init_if_necessary
+ tapped_formulae = Dir['Library/Formula/*'].map do |formula|
+ path = Pathname.new formula
+ next unless path.symlink?
+ Pathname.new(path.realpath.to_s.gsub(/.*Taps\//, ''))
+ end
+ tapped_formulae.compact!
+ unlink_tap_formula(tapped_formulae)
+
report = Report.new
master_updater = Updater.new
- master_updater.pull!
+ begin
+ master_updater.pull!
+ ensure
+ link_tap_formula(tapped_formulae)
+ end
report.merge!(master_updater.report)
Dir["Library/Taps/*"].each do |tapd|