aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-04-17 15:49:43 +0100
committerGitHub2017-04-17 15:49:43 +0100
commitd90398692cf6a673852588223bb1aa0ed8bc8a17 (patch)
treeb458de38655e1b0bb8dd5b071e7303edb9720ece /Library
parent226c24aea01a5d7b42d33671222f94d6eb4d5df1 (diff)
parent5a2c91dbc2cb935ecfc42dc72975a3e721f12154 (diff)
downloadbrew-d90398692cf6a673852588223bb1aa0ed8bc8a17.tar.bz2
Merge pull request #2475 from MikeMcQuaid/uses-deleted
uses: allow checking deleted formulae.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/uses.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb
index b1122c90a..bab174184 100644
--- a/Library/Homebrew/cmd/uses.rb
+++ b/Library/Homebrew/cmd/uses.rb
@@ -28,7 +28,16 @@ module Homebrew
def uses
raise FormulaUnspecifiedError if ARGV.named.empty?
- used_formulae = ARGV.formulae
+ used_formulae_missing = false
+ used_formulae = begin
+ ARGV.formulae
+ rescue FormulaUnavailableError => e
+ opoo e
+ used_formulae_missing = true
+ # If the formula doesn't exist: fake the needed formula object name.
+ ARGV.named.map { |name| OpenStruct.new name: name, full_name: name }
+ end
+
formulae = ARGV.include?("--installed") ? Formula.installed : Formula
recursive = ARGV.flag? "--recursive"
includes = []
@@ -115,5 +124,6 @@ module Homebrew
return if uses.empty?
puts Formatter.columns(uses.map(&:full_name))
+ odie "Missing formulae should not have dependents!" if used_formulae_missing
end
end