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

dev-cmd/unbottled: fix total unbottled count #18327

Merged
merged 1 commit into from
Sep 17, 2024
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: 5 additions & 9 deletions Library/Homebrew/dev-cmd/unbottled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
all_formulae = Formula.all(eval_all: args.eval_all?)
end

# Remove deprecated formulae as we do not care if they are unbottled
formulae = Array(formulae).reject(&:deprecated?) if formulae.present?
all_formulae = Array(all_formulae).reject(&:deprecated?) if all_formulae.present?
# Remove deprecated and disabled formulae as we do not care if they are unbottled
formulae = Array(formulae).reject { |f| f.deprecated? || f.disabled? } if formulae.present?
all_formulae = Array(all_formulae).reject { |f| f.deprecated? || f.disabled? } if all_formulae.present?

[T.let(formulae, T::Array[Formula]), T.let(all_formulae, T::Array[Formula]),
T.let(formula_installs, T.nilable(T::Hash[Symbol, Integer]))]
Expand Down Expand Up @@ -193,12 +193,8 @@
return unless @bottle_tag

ohai "Unbottled :#{@bottle_tag} formulae"
unbottled_formulae = 0

formulae.each do |f|
next if f.bottle_specification.tag?(@bottle_tag)

unbottled_formulae += 1
unbottled_formulae = formulae.count do |f|
!f.bottle_specification.tag?(@bottle_tag, no_older_versions: true)

Check warning on line 197 in Library/Homebrew/dev-cmd/unbottled.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/unbottled.rb#L196-L197

Added lines #L196 - L197 were not covered by tests
end

puts "#{unbottled_formulae}/#{formulae.length} remaining."
Expand Down