aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDominyk Tiller2016-05-07 20:58:20 +0100
committerDominyk Tiller2016-05-07 20:58:20 +0100
commitc5520d0050e3a5a9050314daf643b298a5432d67 (patch)
treeb51495bae441763c6887942bdcabc0c0de42daae /Library
parentd887dd39ec60c70e76a696e5fc9309172962d3c8 (diff)
downloadbrew-c5520d0050e3a5a9050314daf643b298a5432d67.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/requirements/language_module_requirement.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/Library/Homebrew/requirements/language_module_requirement.rb b/Library/Homebrew/requirements/language_module_requirement.rb
index 6985fd2a7..185777013 100644
--- a/Library/Homebrew/requirements/language_module_requirement.rb
+++ b/Library/Homebrew/requirements/language_module_requirement.rb
@@ -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