aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorKaito Udagawa2016-11-19 02:03:30 +0900
committerKaito Udagawa2016-11-19 04:14:26 +0900
commit61c8fff0ee2717522a1fb971ca4ef7450df305b9 (patch)
treed30c183fed4a91c7ba3abe32df734271ae44201d /Library
parente9815bf2bd2950b5450f0c3ed3bb7eadd3b4cbb3 (diff)
downloadbrew-61c8fff0ee2717522a1fb971ca4ef7450df305b9.tar.bz2
install: suppress redundunt warnings with `depends_on` requirement
When a formula depends on any requirements, they evaluated at most three times: before locking, before installing dependent, before building formula. When a non-fatal requirement is specified and thus evaluated three times, mostly the same warning message is also emitted three times. This change restricts printing the warning messages only when a bottle is successfully installed or before building. Since this timing is after the final dependency computation for each cases, the warnings will be most useful to check what is not yet satisfied.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index c05b0da60..e2af9779c 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -251,6 +251,7 @@ class FormulaInstaller
opoo "Bottle installation failed: building from source."
raise BuildToolsError, [formula] unless DevelopmentTools.installed?
else
+ puts @requirement_messages
@poured_bottle = true
end
end
@@ -260,6 +261,7 @@ class FormulaInstaller
unless @poured_bottle
not_pouring = !pour_bottle || @pour_failed
compute_and_install_dependencies if not_pouring && !ignore_deps?
+ puts @requirement_messages
build
clean
@@ -334,17 +336,21 @@ class FormulaInstaller
end
def check_requirements(req_map)
+ @requirement_messages = []
fatals = []
req_map.each_pair do |dependent, reqs|
next if dependent.installed?
reqs.each do |req|
- puts "#{dependent}: #{req.message}"
+ @requirement_messages << "#{dependent}: #{req.message}"
fatals << req if req.fatal?
end
end
- raise UnsatisfiedRequirements, fatals unless fatals.empty?
+ return if fatals.empty?
+
+ puts @requirement_messages
+ raise UnsatisfiedRequirements, fatals
end
def install_requirement_default_formula?(req, dependent, build)