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
efb200e8
Unverified
Commit
efb200e8
authored
5 years ago
by
L. E. Segovia
Browse files
Options
Downloads
Patches
Plain Diff
breadth-first search for dependents upgrade
Fixes Homebrew/brew#6386
parent
a72ea8ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/cmd/upgrade.rb
+25
-20
25 additions, 20 deletions
Library/Homebrew/cmd/upgrade.rb
with
25 additions
and
20 deletions
Library/Homebrew/cmd/upgrade.rb
+
25
−
20
View file @
efb200e8
...
...
@@ -213,37 +213,42 @@ module Homebrew
formulae_to_upgrade
=
Set
.
new
formulae_pinned
=
Set
.
new
formulae
.
each
do
|
formula
|
formulae_to_check
=
formulae
checked_formulae
=
Set
.
new
until
formulae_to_check
.
empty?
descendants
=
Set
.
new
dependents
=
kegs
.
select
do
|
keg
|
keg
.
runtime_dependencies
.
any?
{
|
d
|
d
[
"full_name"
]
==
formula
.
full_name
}
end
formulae_to_check
.
each
do
|
formula
|
next
if
checked_formulae
.
include?
(
formula
)
next
if
dependents
.
empty?
dependents
=
kegs
.
select
do
|
keg
|
keg
.
runtime_dependencies
.
any?
{
|
d
|
d
[
"full_name"
]
==
formula
.
full_name
}
end
dependent_formulae
=
dependents
.
map
(
&
:to_formula
)
next
if
dependents
.
empty?
dependent_formulae
.
each
do
|
f
|
next
if
formulae_to_upgrade
.
include?
(
f
)
next
if
formulae_pinned
.
include?
(
f
)
dependent_formulae
=
dependents
.
map
(
&
:to_formula
)
if
f
.
outdated?
(
fetch_head:
args
.
fetch_HEAD?
)
if
f
.
pinned?
formulae_pinned
<<
f
else
formulae_to_upgrade
<<
f
dependent_formulae
.
each
do
|
f
|
next
if
formulae_to_upgrade
.
include?
(
f
)
next
if
formulae_pinned
.
include?
(
f
)
if
f
.
outdated?
(
fetch_head:
args
.
fetch_HEAD?
)
if
f
.
pinned?
formulae_pinned
<<
f
else
formulae_to_upgrade
<<
f
end
end
descendants
<<
f
end
descendants
<<
f
checked_formulae
<<
formula
end
upgradable_descendants
,
pinned_descendants
=
upgradable_dependents
(
kegs
,
descendants
)
formulae_to_upgrade
.
merge
upgradable_descendants
formulae_pinned
.
merge
pinned_descendants
formulae_to_check
=
descendants
end
[
formulae_to_upgrade
,
formulae_pinned
]
...
...
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