Homebrew-cask: Deprecate `--caskroom` flag

Created on 11 Jun 2016  Â·  12Comments  Â·  Source: Homebrew/homebrew-cask

In a similar vein to https://github.com/caskroom/homebrew-cask/issues/21372, in merging with Homebrew and moving the Caskroom inside their directory by default, why would you ever want your Caskroom in a separate location?

We would simplify the code by removing the flag. Even when creating the Caskroom for the first time, this (26 lines with multiple sudos) could become this (9 lines, no sudos):

def self.init
  odebug 'Creating directories'
  HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
  HOMEBREW_CACHE_CASKS.mkpath unless HOMEBREW_CACHE_CASKS.exist?
  unless caskroom.exist?
    ohai "Creating Caskroom at #{caskroom}"
    system '/bin/mkdir', '--', caskroom
  end
end

Most helpful comment

Do you have set HOMEBREW_CASK_OPTS? If so, remove the --caskroom flag from it.

All 12 comments

@vitorgalvao I am very much in favor of this – as long as the particular minority I’m lobbying for is not affected; and it indeed is not. (I would make for a terrible politician!)

Removing things no one really needs anymore is _exactly_ what keeps a product from becoming a big ball of mud. :+1:

In light of the feedback we've been getting after #21857 (e.g. #21894), I think we should hold off on this for a while. I feel like we jumped the gun, and should have made sure to notify users of the change and ensure that their old Caskroom would remain intact, at least for a specified transitional period.

I'm away from my computer at the moment, but unless someone beats me to it (@claui has been killing it lately), I'm going to write up a PR this evening that will use the old path if it exists, warn users that the default has changed, and encourage them to add --caskroom=/opt/homebrew-cask/Caskroom to HOMEBREW_CASK_OPTS to prevent data duplication and installation issues.

@jawshooah Made an official answer before we start getting bashed by the less friendly users.

As for the fix, I think we should both encourage adding --caskroom=/opt/homebrew-cask/Caskroom _or_ moving the Caskroom. You suggestions from the other issue, basically.

Changed title to Deprecate--caskroomflag as deprecation doesn’t automatically make it stop working.

Started seeing this:

Warning: Calling `brew cask` with the `--caskroom` flag is deprecated and will be disabled on 2017-10-31!

Where exactly is the new location?

Here is my brew config output:

> brew config
HOMEBREW_VERSION: 1.2.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: b5529084906af89827f6d9befd613457a1615918
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ff3cf9dfb84d229e1f5fa02728d518f6622ce74e
Core tap last commit: 7 hours ago
HOMEBREW_PREFIX: /Users/balupton/.homebrew
HOMEBREW_REPOSITORY: /Users/balupton/.homebrew
HOMEBREW_CELLAR: /Users/balupton/.homebrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.13.2 => /Users/balupton/.homebrew/bin/git
Perl: /usr/bin/perl
Python: /Users/balupton/.homebrew/bin/python => /Users/balupton/.homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/balupton/.homebrew/bin/ruby => /Users/balupton/.homebrew/Cellar/ruby/2.4.1_1/bin/ruby
Java: N/A
macOS: 10.12.5-x86_64
Xcode: 8.3.3
CLT: N/A
X11: N/A

Configured via: https://github.com/balupton/dotfiles/blob/7cf12331de5462ad3f377609deaa9c9cd101c83e/.scripts/sources/mac.sh

Where exactly is the new location?

The new location is $(brew --prefix)/Caskroom.

Okay cool! Any plan for a brew --caskroomdir flag or so?

google-cloud-sdk needs some dotfile adjustments at the caskroom folder, so having a flag like that would make it easy to get the location

Okay cool! Any plan for a brew --caskroomdir flag or so?

For what? $(brew --prefix)/Caskroom already does that and is dynamic. It isn’t worth it to add an extra option.

Warning: Calling brew cask with the --caskroom flag is deprecated and will be disabled on 2017-10-31!

Started seeing this too. What does it mean? All I executed was brew cask list

Do you have set HOMEBREW_CASK_OPTS? If so, remove the --caskroom flag from it.

Ah yes, that's it. Thank you @reitermarkus

Remove --caskroom=/usr/local/Caskroom from the .bash_profile worked for me

before:
export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=/usr/local/Caskroom"

after:
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"

Was this page helpful?
0 / 5 - 0 ratings