aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
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/Homebrew/cmd
parente97610b9160a3c94e4caf94ff6f036a8c9b4a78a (diff)
downloadbrew-82689d81f71082416eff8c737deefa5523a10cfb.tar.bz2
use Tap#install
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/install.rb5
-rw-r--r--Library/Homebrew/cmd/update.rb6
2 files changed, 7 insertions, 4 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