Skip to content

Commit

Permalink
Deprecate installing casks/formulae from paths.
Browse files Browse the repository at this point in the history
We've already disabled installing casks/formulae from URLs and we
regularly tell people not to install from paths so let's just deprecate
this behaviour entirely.

Even Homebrew developers do not need to work this way.
  • Loading branch information
MikeMcQuaid committed Sep 25, 2024
1 parent d3cc0c3 commit 816186b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/cask/cask_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def initialize(url)
def load(config:)
path.dirname.mkpath

odeprecated "installing casks from paths or URLs", "installing casks from taps"

if ALLOWED_URL_SCHEMES.exclude?(url.scheme)
raise UnsupportedInstallationMethod,
"Non-checksummed download of #{name} formula file from an arbitrary URL is unsupported! " \
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/formulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ def initialize(url, from: nil)
uri_path = URI(url).path
raise ArgumentError, "URL has no path component" unless uri_path

odeprecated "installing formulae from paths or URLs", "installing formulae from taps"

formula = File.basename(uri_path, ".rb")
super formula, HOMEBREW_CACHE_FORMULA/File.basename(uri_path)
end
Expand Down

0 comments on commit 816186b

Please sign in to comment.