languages: flag missing dependency requirement (#194)
This is in part designed to handle situations described in https://github.com/Homebrew/legacy-homebrew/issues/42273 where we tell someone to install a special dependency, but because we (rightly, IMO) resolve special dependencies first users can end up being told to execute a command on a tool that isn't yet installed and isn't immediately obvious how to install it. In the situation raised there, with the `sile` formula people are being told to `luarocks install xyz` but we hadn't installed Lua for them first, so they just get a `command not found: luarocks` message. Perhaps it should be obvious enough how to install said tools by looking at the formula's dependencies, but it's not a huge burden on us to make life easier than that. Shuffled over from https://github.com/Homebrew/legacy-homebrew/pull/42576.
This commit is contained in:
parent
d887dd39ec
commit
c5520d0050
@ -12,11 +12,22 @@ class LanguageModuleRequirement < Requirement
|
||||
|
||||
satisfy(:build_env => false) { quiet_system(*the_test) }
|
||||
|
||||
def message; <<-EOS.undent
|
||||
Unsatisfied dependency: #{@module_name}
|
||||
Homebrew does not provide #{@language.to_s.capitalize} dependencies; install with:
|
||||
#{command_line} #{@module_name}
|
||||
def message
|
||||
s = <<-EOS.undent
|
||||
Unsatisfied dependency: #{@module_name}
|
||||
Homebrew does not provide special #{@language.to_s.capitalize} dependencies; install with:
|
||||
`#{command_line} #{@module_name}`
|
||||
EOS
|
||||
|
||||
unless [:python, :perl, :ruby].include? @language
|
||||
s += <<-EOS.undent
|
||||
|
||||
You may need to: `brew install #{@language}`
|
||||
|
||||
EOS
|
||||
end
|
||||
|
||||
s
|
||||
end
|
||||
|
||||
def the_test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user