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

Add HOMEBREW_UPGRADE_GREEDY option #15160

Merged
merged 7 commits into from Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Library/Homebrew/cask/upgrade.rb
Expand Up @@ -42,6 +42,8 @@ def self.upgrade_casks(

quarantine = true if quarantine.nil?

greedy = true if Homebrew::EnvConfig.upgrade_greedy?

outdated_casks = if casks.empty?
Caskroom.casks(config: Config.from_args(args)).select do |cask|
cask.outdated?(greedy: greedy, greedy_latest: greedy_latest,
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/env_config.rb
Expand Up @@ -344,6 +344,10 @@ module EnvConfig
description: "If set, use Pry for the `brew irb` command.",
boolean: true,
},
HOMEBREW_UPGRADE_GREEDY: {
description: "If set, pass `--greedy` to all cask upgrade commands.",
boolean: true,
},
HOMEBREW_SIMULATE_MACOS_ON_LINUX: {
description: "If set, running Homebrew on Linux will simulate certain macOS code paths. This is useful " \
"when auditing macOS formulae while on Linux.",
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/env_config.rbi
Expand Up @@ -229,6 +229,9 @@ module Homebrew::EnvConfig
sig { returns(T::Boolean) }
def self.update_to_tag?; end

sig { returns(T::Boolean) }
def self.upgrade_greedy?; end

sig { returns(T::Boolean) }
def self.verbose?; end

Expand Down