diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index a91882a6e5049..930ecc1d3a797 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -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! " \ diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 67ae6b78ad7c7..0a1d42b49f688 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -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