aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-11-07 16:36:14 +0800
committerXu Cheng2015-11-09 15:34:20 +0800
commit82689d81f71082416eff8c737deefa5523a10cfb (patch)
tree5d0037aa665b1e3b6b01e7f45ce0475b570f2223 /Library
parente97610b9160a3c94e4caf94ff6f036a8c9b4a78a (diff)
downloadbrew-82689d81f71082416eff8c737deefa5523a10cfb.tar.bz2
use Tap#install
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb5
-rw-r--r--Library/Homebrew/cmd/update.rb6
-rw-r--r--Library/Homebrew/formula_installer.rb8
3 files changed, 11 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index ac1b37b72..755d944dc 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -16,7 +16,10 @@ module Homebrew
ARGV.named.each do |name|
if !File.exist?(name) && (name !~ HOMEBREW_CORE_FORMULA_REGEX) \
&& (name =~ HOMEBREW_TAP_FORMULA_REGEX || name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX)
- install_tap $1, $2
+ user = $1
+ repo = $2.sub(/^homebrew-/, "")
+ tap = Tap.fetch(user, repo)
+ tap.install
end
end unless ARGV.force?
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 45c83b040..70d381250 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -82,12 +82,12 @@ module Homebrew
next unless (dir = HOMEBREW_CELLAR/f).exist?
migration = TAP_MIGRATIONS[f]
next unless migration
- tap_user, tap_repo = migration.split "/"
- install_tap tap_user, tap_repo
+ tap = Tap.fetch(*migration.split("/"))
+ tap.install
# update tap for each Tab
tabs = dir.subdirs.map { |d| Tab.for_keg(Keg.new(d)) }
next if tabs.first.source["tap"] != "Homebrew/homebrew"
- tabs.each { |tab| tab.source["tap"] = "#{tap_user}/homebrew-#{tap_repo}" }
+ tabs.each { |tab| tab.source["tap"] = "#{tap.user}/homebrew-#{tap.repo}" }
tabs.each(&:write)
end if load_tap_migrations
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 9946d4ad4..c25f44295 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -8,7 +8,6 @@ require "caveats"
require "cleaner"
require "formula_cellar_checks"
require "install_renamed"
-require "cmd/tap"
require "cmd/postinstall"
require "hooks/bottles"
require "debrew"
@@ -115,10 +114,11 @@ class FormulaInstaller
begin
formula.recursive_dependencies.map(&:to_formula)
rescue TapFormulaUnavailableError => e
- if Homebrew.install_tap(e.user, e.repo)
- retry
- else
+ if e.tap.installed?
raise
+ else
+ e.tap.install
+ retry
end
end
rescue FormulaUnavailableError => e