aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/test-bot.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 0418b7dec..a346eeb7d 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -428,9 +428,32 @@ module Homebrew
return
end
+ conflicts = formula.conflicts
+ formula.recursive_dependencies.each do |dependency|
+ conflicts += dependency.to_formula.conflicts
+ end
+
+ conflicts.each do |conflict|
+ confict_formula = Formulary.factory(conflict.name)
+
+ if confict_formula.installed? && confict_formula.linked_keg.exist?
+ test "brew", "unlink", "--force", conflict.name
+ end
+ end
+
installed = Utils.popen_read("brew", "list").split("\n")
dependencies = Utils.popen_read("brew", "deps", "--skip-optional",
canonical_formula_name).split("\n")
+
+ (installed & dependencies).each do |installed_dependency|
+ installed_dependency_formula = Formulary.factory(installed_dependency)
+ if installed_dependency_formula.installed? &&
+ !installed_dependency_formula.keg_only? &&
+ !installed_dependency_formula.linked_keg.exist?
+ test "brew", "link", installed_dependency
+ end
+ end
+
dependencies -= installed
unchanged_dependencies = dependencies - @formulae
changed_dependences = dependencies - unchanged_dependencies