Skip to content

Commit

Permalink
Merge pull request #18327 from Homebrew/unbottled-total
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed Sep 17, 2024
2 parents 335d370 + 133e46e commit 998cd12
Showing 1 changed file with 5 additions and 9 deletions.
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 @@ def formulae_all_installs_from_args(all)
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 @@ def output_total(formulae)
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)
end

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

0 comments on commit 998cd12

Please sign in to comment.