diff --git a/doc/FAQ.md b/doc/FAQ.md index 43eabd5a4568..eef2f2c0f5c7 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -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! diff --git a/doc/TAP_MIGRATION.md b/doc/TAP_MIGRATION.md deleted file mode 100644 index 5c058677f416..000000000000 --- a/doc/TAP_MIGRATION.md +++ /dev/null @@ -1,167 +0,0 @@ -# Tap Migration - - * [Overview](#overview) - * [What Users Should Do](#what-users-should-do) - * [Uncommitted Casks May Be Deleted](#uncommitted-casks-may-be-deleted) - * [If Something Goes Wrong](#if-something-goes-wrong) - * [Technical Background - Parent Project (Homebrew)](#parent-project-homebrew) - * [Technical Background - Our Project (Homebrew-cask)](#our-project-homebrew-cask) - -## Overview - -During April-May 2014, the default location of the Homebrew-cask Tap was -moved to a new location on disk, from - - "$(brew --repository)"/Library/Taps/phinze-cask - -to - - "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask - -(where `"$(brew --repository)"` typically evaluates to `/usr/local`). - -The migration should be seamless, but some users have experienced glitches. -We are still [making improvements](https://github.com/caskroom/homebrew-cask/pull/4169) to aid in the transition. - -## What Users Should Do - -All users should upgrade to the latest Homebrew (0.9.5 or better), and the -latest Homebrew-cask (0.34.0 or better): - -```bash -$ brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup -``` - -The first time you execute a `brew cask` command, all Tap migrations -should happen for you automatically. - -## Uncommitted Casks May Be Deleted - -If you have recently created a Cask using `brew cask create`, and have not -submitted that Cask to the main GitHub repository (meaning that your local -repository is dirty), you should be aware that Homebrew may delete your -uncommited Casks during the process of Tap migration. See - -* - -If you are not in the midst of authoring a Cask, this issue will not affect -you. - -## If Something Goes Wrong - -If something goes wrong with automatic Tap migration: - -### Run "brew update" Twice - -Try running `brew update` again. Some users report that Homebrew's Tap -migration does not fire on the first try. - -### Run Any "brew cask" Command - -Try running (for example) `brew cask doctor`. Each time you issue a `brew -cask` command, we examine your directory layout, and attempt to upgrade your -Taps to follow the new standard. - -### Check Your Taps - -The output of the command - -```bash -$ brew tap -``` - -should show `caskroom/cask` in the output. It should **not** show the -old Tap `phinze/cask`. - -### Manually Convert Your Taps - -The following command should migrate you to the new Tap: - -```bash -$ brew untap phinze/cask; brew tap caskroom/cask -``` - -### Manually Check Tap Directories - -The following directory should exist: - -```bash -$ ls -ld "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask -``` - -The following directories should **not** exist: - -```bash -$ ls -ld "$(brew --repository)"/Library/Taps/phinze/homebrew-cask -$ ls -ld "$(brew --repository)"/Library/Taps/phinze-cask -``` - -### "Could not tap" Message - -You may see the message - - Warning: Could not tap caskroom/homebrew-cask/brew-cask over phinze/homebrew-cask/brew-cask - -during Tap migration, which means that two conflicting Taps are present. - -The auto-migrate code should fix this problem. If you continue to see this -message on subsequent commands, refer to [Manually Check Tap Directories](#manually-check-tap-directories) above. - -### File an Issue - -Please do let us hear from you if you are having problems. Open an issue at -[GitHub issues page](https://github.com/caskroom/homebrew-cask/issues?state=open), -or find an open issue which duplicates your problem. - -It would be helpful to run - -```bash -$ brew cask doctor -``` - -and paste the results into your comment. - -## Technical Background - -### Parent Project (Homebrew) - -Though we are separate projects, [Homebrew-cask](http://caskroom.io) is -built on the infrastructure provided by [Homebrew](http://brew.sh). - -On [24 Apr 2014](https://github.com/Homebrew/homebrew/commit/e07584e3fbdc88327bafe23b9c40c904d0fff0a1), the parent project Homebrew changed the layout of -the Tap directory to follow the form - - "$(brew --repository)"/Library/Taps// - -rather than - - "$(brew --repository)"/Library/Taps/- - -causing our project to be moved from - - "$(brew --repository)"/Library/Taps/phinze-cask - -to - - "$(brew --repository)"/Library/Taps/phinze/homebrew-cask - -### Our Project (Homebrew-cask) - -On [3 May 2014](https://github.com/caskroom/homebrew-cask/pull/4163), our -project also made a change affecting Taps. The main Homebrew-cask repo -moved from - -https://github.com/phinze/homebrew-cask - -to - -https://github.com/caskroom/homebrew-cask - -This means that the username portion of our Tap path changed from `phinze` -to `caskroom`, *ie*: - - "$(brew --repository)"/Library/Taps/phinze/homebrew-cask - -became - - "$(brew --repository)"/Library/Taps/caskroom/homebrew-cask diff --git a/lib/cask.rb b/lib/cask.rb index 72f08864c282..207b1aa334a4 100644 --- a/lib/cask.rb +++ b/lib/cask.rb @@ -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' @@ -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". @@ -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