aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-12-30 16:37:28 +0000
committerGitHub2016-12-30 16:37:28 +0000
commitc087c530ae16af05fcc8598c8f3515f3de7d9e33 (patch)
tree55946c994ed739fbf0b79eb45c40cb109ba34c60 /Library
parent340000ce87b89a9ab605b50edc42fd0753e3e5ba (diff)
parent7f75b02133b10748ae9c26a0369f230782f974d5 (diff)
downloadbrew-c087c530ae16af05fcc8598c8f3515f3de7d9e33.tar.bz2
Merge pull request #1749 from MikeMcQuaid/optional-check-recursive-dependencies
formula_installer: optional deps version check.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index c701aeb39..90e283c9b 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -148,18 +148,24 @@ class FormulaInstaller
recursive_deps = formula.recursive_dependencies
recursive_formulae = recursive_deps.map(&:to_formula)
- version_hash = {}
- version_conflicts = Set.new
- recursive_formulae.each do |f|
- name = f.name
- unversioned_name, = name.split("@")
- version_hash[unversioned_name] ||= Set.new
- version_hash[unversioned_name] << name
- next if version_hash[unversioned_name].length < 2
- version_conflicts += version_hash[unversioned_name]
- end
- unless version_conflicts.empty?
- raise CannotInstallFormulaError, "#{formula.full_name} contains conflicting version dependencies (#{version_conflicts.to_a.join " "}) so cannot be installed"
+ if ENV["HOMEBREW_CHECK_RECURSIVE_VERSION_DEPENDENCIES"]
+ version_hash = {}
+ version_conflicts = Set.new
+ recursive_formulae.each do |f|
+ name = f.name
+ unversioned_name, = name.split("@")
+ version_hash[unversioned_name] ||= Set.new
+ version_hash[unversioned_name] << name
+ next if version_hash[unversioned_name].length < 2
+ version_conflicts += version_hash[unversioned_name]
+ end
+ unless version_conflicts.empty?
+ raise CannotInstallFormulaError, <<-EOS.undent
+ #{formula.full_name} contains conflicting version recursive dependencies:
+ #{version_conflicts.to_a.join ", "}
+ View these with `brew deps --tree #{formula.full_name}`.
+ EOS
+ end
end
unlinked_deps = recursive_formulae.select do |dep|