Skip to content
Snippets Groups Projects
Commit ffa5ebde authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #1863 from alyssais/uses_ignore_untapped

uses: properly handle untapped formulae in recursive dependency expansion (again!)
parents 1497dfac 9475622c
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,12 @@ module Homebrew ...@@ -57,6 +57,12 @@ module Homebrew
elsif dep.build? elsif dep.build?
Dependency.prune unless includes.include?("build?") Dependency.prune unless includes.include?("build?")
end end
# If a tap isn't installed, we can't find the dependencies of one
# its formulae, and an exception will be thrown if we try.
if dep.is_a?(TapDependency) && !dep.tap.installed?
Dependency.keep_but_prune_recursive_deps
end
end end
dep_formulae = deps.map do |dep| dep_formulae = deps.map do |dep|
......
...@@ -175,7 +175,7 @@ class TapDependency < Dependency ...@@ -175,7 +175,7 @@ class TapDependency < Dependency
attr_reader :tap attr_reader :tap
def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name.split("/").last]) def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name.split("/").last])
@tap = name.rpartition("/").first @tap = Tap.fetch(name.rpartition("/").first)
super(name, tags, env_proc, option_names) super(name, tags, env_proc, option_names)
end end
......
...@@ -118,6 +118,11 @@ class DependencyTests < Homebrew::TestCase ...@@ -118,6 +118,11 @@ class DependencyTests < Homebrew::TestCase
end end
class TapDependencyTests < Homebrew::TestCase class TapDependencyTests < Homebrew::TestCase
def test_tap
dep = TapDependency.new("foo/bar/dog")
assert_equal Tap.new("foo", "bar"), dep.tap
end
def test_option_names def test_option_names
dep = TapDependency.new("foo/bar/dog") dep = TapDependency.new("foo/bar/dog")
assert_equal %w[dog], dep.option_names assert_equal %w[dog], dep.option_names
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment