aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2015-03-20 21:32:22 +0000
committerMike McQuaid2015-03-23 13:30:55 +0000
commita4f474ddb962fb7b93b5d355c200c21937e6c9e2 (patch)
tree9fb8e608a576981136baa311958ddd1bc93bf615
parente7053ac35a2978bb32ff6daef6c40a6d7d9ee4b0 (diff)
downloadbrew-a4f474ddb962fb7b93b5d355c200c21937e6c9e2.tar.bz2
test-bot: uninstall build deps before bottle test.
This should hopefully more often catch the situation where things are marked as build dependencies incorrectly. Closes Homebrew/homebrew#37927. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
-rw-r--r--Library/Homebrew/cmd/test-bot.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 683c6de18..b0d90ec5e 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -366,11 +366,19 @@ module Homebrew
end
test "brew", "uses", canonical_formula_name
- dependencies = Utils.popen_read("brew", "deps", canonical_formula_name).split("\n")
- dependencies -= Utils.popen_read("brew", "list").split("\n")
+ installed = Utils.popen_read("brew", "list").split("\n")
+ dependencies = Utils.popen_read("brew", "deps", "--skip-optional",
+ canonical_formula_name).split("\n")
+ dependencies -= installed
unchanged_dependencies = dependencies - @formulae
changed_dependences = dependencies - unchanged_dependencies
+ runtime_dependencies = Utils.popen_read("brew", "deps",
+ "--skip-build", "--skip-optional",
+ canonical_formula_name).split("\n")
+ build_dependencies = dependencies - runtime_dependencies
+ unchanged_build_dependencies = build_dependencies - @formulae
+
dependents = Utils.popen_read("brew", "uses", "--skip-build", "--skip-optional", canonical_formula_name).split("\n")
dependents -= @formulae
dependents = dependents.map {|d| Formulary.factory(d)}
@@ -467,6 +475,10 @@ module Homebrew
bottle_filename =
bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
test "brew", "uninstall", "--force", canonical_formula_name
+ if unchanged_build_dependencies.any?
+ test "brew", "uninstall", "--force", *unchanged_build_dependencies
+ unchanged_dependencies -= unchanged_build_dependencies
+ end
test "brew", "install", bottle_filename
end
end
@@ -500,7 +512,7 @@ module Homebrew
test "brew", "uninstall", "--devel", "--force", canonical_formula_name
end
end
- test "brew", "uninstall", "--force", *unchanged_dependencies unless unchanged_dependencies.empty?
+ test "brew", "uninstall", "--force", *unchanged_dependencies if unchanged_dependencies.any?
end
def homebrew