Skip to content

Commit

Permalink
Merge pull request #7529 from rolandwalker/remove_tap_migration
Browse files Browse the repository at this point in the history
Remove automatic tap migration code and docs
  • Loading branch information
rolandwalker committed Nov 23, 2014
2 parents 7de43a4 + 31f81cc commit 367e0f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 216 deletions.
9 changes: 6 additions & 3 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ under the organizational umbrella at https://github.com/caskroom/homebrew-cask .

Web redirection happens automatically.

The location of the Homebrew-cask Tap on disk has also changed, which should be
handled automatically upon upgrading. If you have technical difficulties,
please see [TAP_MIGRATION.md](TAP_MIGRATION.md).
The location of the Homebrew-cask Tap on disk has also changed. If you have
a very old installation, you may need to run:

```bash
$ brew untap phinze/cask; brew tap caskroom/cask
```

## `brew cask list` shows that a package is installed, but when I try to do `brew cask uninstall`, it tells me that the package is not installed. Help!

Expand Down
167 changes: 0 additions & 167 deletions doc/TAP_MIGRATION.md

This file was deleted.

46 changes: 0 additions & 46 deletions lib/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ class Cask; end

require 'download_strategy'

# transitional, for set_up_taps (see below)
require 'cmd/update'
require 'rubygems'

require 'cask/artifact'
require 'cask/audit'
require 'cask/auditor'
Expand Down Expand Up @@ -47,7 +43,6 @@ class Cask
include Cask::Utils

def self.init
set_up_taps
# todo: Creating directories should be deferred until needed.
# Currently this fire and even asks for sudo password
# if a first-time user simply runs "brew cask --help".
Expand Down Expand Up @@ -78,47 +73,6 @@ def self.init
end
end

def self.set_up_taps
odebug 'Initializing Taps'

return true if Cask.default_tap.match(%r{test[^/]*\Z})

# transitional: help with Homebrew's move of Tap dirs, Apr 2014
minimum_homebrew_version = '0.9.5'
unless Gem::Version.new(HOMEBREW_VERSION) >= Gem::Version.new(minimum_homebrew_version)
raise CaskError.new <<-EOS.undent
Minimum Homebrew version '#{minimum_homebrew_version}' required.
(Homebrew version #{HOMEBREW_VERSION} was detected.)
Try running "brew update".
EOS
end
begin
Homebrew.send(:rename_taps_dir_if_necessary)
rescue StandardError
opoo %q{Trouble with automatic Tap migration. You may need to run "brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup"}
end

# transitional: help with our own move to new GitHub project, May 2014
legacy_user = 'phinze'
new_user = 'caskroom'
repo = 'cask'
legacy_tap = HOMEBREW_LIBRARY/"Taps/#{legacy_user}/homebrew-#{repo}"
new_tap = HOMEBREW_LIBRARY/"Taps/#{new_user}/homebrew-#{repo}"
if legacy_tap.directory?
ohai 'Removing legacy Tap'
files = []
legacy_tap.find_formula { |file| files << file }
Homebrew.unlink_tap_formula(files)
legacy_tap.rmtree
legacy_tap.dirname.rmdir_if_possible
end
unless new_tap.directory?
ohai 'Adding caskroom Tap'
Homebrew.install_tap(new_user, repo)
end
Cask.reset_all_tapped_cask_dirs
end

def self.load(query)
odebug 'Loading Cask definitions'
cask = Cask::Source.for_query(query).load
Expand Down

0 comments on commit 367e0f2

Please sign in to comment.