Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set prefer_loading_from_api: true for brew fetch #13089

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Library/Homebrew/cmd/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,26 @@ def fetch
args = fetch_args.parse

bucket = if args.deps?
args.named.to_formulae_and_casks.flat_map do |formula_or_cask|
args.named.to_formulae_and_casks(prefer_loading_from_api: true).flat_map do |formula_or_cask|
case formula_or_cask
when Formula
f = formula_or_cask

[f, *f.recursive_dependencies.map(&:to_formula)]
deps = if Homebrew::EnvConfig.install_from_api?
f.recursive_dependencies do |_, dependency|
Dependency.prune if EnvConfig.install_from_api? && (dependency.build? || dependency.test?)
end
else
f.recursive_dependencies
end

[f, *deps.map(&:to_formula)]
else
formula_or_cask
end
end
else
args.named.to_formulae_and_casks
args.named.to_formulae_and_casks(prefer_loading_from_api: true)
end.uniq

puts "Fetching: #{bucket * ", "}" if bucket.size > 1
Expand Down