Skip to content

Commit 0c09ed7

Browse files
committed
formula_installer: fix fetch deps and local pour for download queue.
1 parent d3a9525 commit 0c09ed7

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Library/Homebrew/formula_installer.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ def prelude_fetch
320320
# Needs to be done before expand_dependencies for compute_dependencies
321321
fetch_bottle_tab if pour_bottle?
322322

323+
fetch_fetch_deps unless ignore_deps?
324+
323325
@ran_prelude_fetch = true
324326
end
325327

@@ -346,7 +348,9 @@ def prelude
346348
forbidden_formula_check
347349

348350
check_install_sanity
349-
install_fetch_deps unless ignore_deps?
351+
352+
# with the download queue: these should have already been installed
353+
install_fetch_deps if !ignore_deps? && download_queue.nil?
350354
end
351355

352356
sig { void }
@@ -475,6 +479,18 @@ def check_install_sanity
475479
sig { params(_formula: Formula).returns(T.nilable(T::Boolean)) }
476480
def fresh_install?(_formula) = false
477481

482+
sig { void }
483+
def fetch_fetch_deps
484+
return if @compute_dependencies.blank?
485+
486+
compute_dependencies(use_cache: false) if @compute_dependencies.any? do |dep,|
487+
next false unless dep.implicit?
488+
489+
fetch_dependencies
490+
true
491+
end
492+
end
493+
478494
sig { void }
479495
def install_fetch_deps
480496
return if @compute_dependencies.blank?
@@ -1455,8 +1471,6 @@ def fetch
14551471
# We also skip bottle installs from local bottle paths, as these are done in CI
14561472
# as part of the build lifecycle before attestations are produced.
14571473
if check_attestation &&
1458-
# TODO: support this for download queues at some point
1459-
download_queue.nil? &&
14601474
Homebrew::Attestation.enabled? &&
14611475
formula.tap&.core_tap? &&
14621476
formula.name != "gh"
@@ -1545,7 +1559,7 @@ def pour
15451559
# download queue has already done the actual staging but we'll lie about
15461560
# pouring now for nicer output
15471561
ohai "Pouring #{downloadable.downloader.basename}"
1548-
downloadable.downloader.stage unless download_queue
1562+
downloadable.downloader.stage if download_queue.nil? || !formula.prefix.exist?
15491563
end
15501564

15511565
Tab.clear_cache

0 commit comments

Comments
 (0)