Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
96df4fe1
Commit
96df4fe1
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Apply cyclic dependency hack unconditionally
parent
e9b68707
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/dependency.rb
+3
-1
3 additions, 1 deletion
Library/Homebrew/dependency.rb
Library/Homebrew/test/test_dependency_expansion.rb
+7
-7
7 additions, 7 deletions
Library/Homebrew/test/test_dependency_expansion.rb
with
10 additions
and
8 deletions
Library/Homebrew/dependency.rb
+
3
−
1
View file @
96df4fe1
...
...
@@ -75,6 +75,9 @@ class Dependency
expanded_deps
=
[]
deps
.
each
do
|
dep
|
# FIXME don't hide cyclic dependencies
next
if
dependent
.
name
==
dep
.
name
case
action
(
dependent
,
dep
,
&
block
)
when
:prune
next
...
...
@@ -83,7 +86,6 @@ class Dependency
when
:keep_but_prune_recursive_deps
expanded_deps
<<
dep
else
next
if
dependent
.
to_s
==
dep
.
name
expanded_deps
.
concat
(
expand
(
dep
.
to_formula
,
&
block
))
expanded_deps
<<
dep
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_dependency_expansion.rb
+
7
−
7
View file @
96df4fe1
...
...
@@ -4,7 +4,7 @@ require 'dependency'
class
DependencyExpansionTests
<
Test
::
Unit
::
TestCase
def
build_dep
(
name
,
tags
=
[],
deps
=
[])
dep
=
Dependency
.
new
(
name
.
to_s
,
tags
)
dep
.
stubs
(
:to_formula
).
returns
(
stub
(
:deps
=>
deps
))
dep
.
stubs
(
:to_formula
).
returns
(
stub
(
:deps
=>
deps
,
:name
=>
name
))
dep
end
...
...
@@ -14,7 +14,7 @@ class DependencyExpansionTests < Test::Unit::TestCase
@baz
=
build_dep
(
:baz
)
@qux
=
build_dep
(
:qux
)
@deps
=
[
@foo
,
@bar
,
@baz
,
@qux
]
@f
=
stub
(
:deps
=>
@deps
)
@f
=
stub
(
:deps
=>
@deps
,
:name
=>
"f"
)
end
def
test_expand_yields_dependent_and_dep_pairs
...
...
@@ -43,19 +43,19 @@ class DependencyExpansionTests < Test::Unit::TestCase
end
def
test_expand_preserves_dependency_order
@foo
.
stubs
(
:to_formula
).
returns
(
stub
(
:deps
=>
[
@qux
,
@baz
]))
@foo
.
stubs
(
:to_formula
).
returns
(
stub
(
:name
=>
"f"
,
:deps
=>
[
@qux
,
@baz
]))
assert_equal
[
@qux
,
@baz
,
@foo
,
@bar
],
Dependency
.
expand
(
@f
)
end
def
test_expand_skips_optionals_by_default
@foo
.
expects
(
:optional?
).
returns
(
true
)
@f
=
stub
(
:deps
=>
@deps
,
:build
=>
stub
(
:with?
=>
false
))
@f
=
stub
(
:deps
=>
@deps
,
:build
=>
stub
(
:with?
=>
false
)
,
:name
=>
"f"
)
assert_equal
[
@bar
,
@baz
,
@qux
],
Dependency
.
expand
(
@f
)
end
def
test_expand_keeps_recommendeds_by_default
@foo
.
expects
(
:recommended?
).
returns
(
true
)
@f
=
stub
(
:deps
=>
@deps
,
:build
=>
stub
(
:with?
=>
true
))
@f
=
stub
(
:deps
=>
@deps
,
:build
=>
stub
(
:with?
=>
true
)
,
:name
=>
"f"
)
assert_equal
@deps
,
Dependency
.
expand
(
@f
)
end
...
...
@@ -84,7 +84,7 @@ class DependencyExpansionTests < Test::Unit::TestCase
end
def
test_skip_skips_parent_but_yields_children
f
=
stub
(
:deps
=>
[
f
=
stub
(
:name
=>
"f"
,
:deps
=>
[
build_dep
(
:foo
,
[],
[
@bar
,
@baz
]),
build_dep
(
:foo
,
[],
[
@baz
]),
])
...
...
@@ -97,7 +97,7 @@ class DependencyExpansionTests < Test::Unit::TestCase
end
def
test_keep_dep_but_prune_recursive_deps
f
=
stub
(
:deps
=>
[
f
=
stub
(
:name
=>
"f"
,
:deps
=>
[
build_dep
(
:foo
,
[
:build
],
[
@bar
]),
build_dep
(
:baz
,
[
:build
]),
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment