Skip to content
Snippets Groups Projects
Commit c5520d00 authored by Dominyk Tiller's avatar Dominyk Tiller
Browse files

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.
parent d887dd39
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment