Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
40.63k stars 9.53k forks source link

regression: Exit code is no longer `1` when listing versions of nonexistent formula/cask #17464

Closed dinofx closed 2 months ago

dinofx commented 2 months ago

brew doctor output

%brew --version
Homebrew 4.3.4-16-g87433c1
Homebrew/homebrew-core (git revision 5bff65e7dfa; last commit 2024-06-10)
Homebrew/homebrew-cask (git revision 6476da9c1b; last commit 2024-06-10)

Verification

brew config output

HOMEBREW_VERSION: 4.3.4-16-g87433c1
ORIGIN: https://github.com/Homebrew/brew
HEAD: 87433c1cd930b9c4c618c41edf1024f8232d12ad
Last commit: 31 minutes ago
Core tap HEAD: 5bff65e7dfa2d85f98c9347476b0dec983083111
Core tap last commit: 29 minutes ago
Core tap JSON: 10 Jun 19:30 UTC
Core cask tap HEAD: 6476da9c1b576ab4f2fc719770e405429839f38a
Core cask tap last commit: 12 minutes ago
Core cask tap JSON: 10 Jun 19:30 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.2 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.2/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

What were you trying to do (and why)?

Run a command to determine if and local versions of a formula/cask exist. For example:

%brew ls --versions doesnotexist; echo $?
0

What happened (include all command output)?

The process exited normally

What did you expect to happen?

In versions 4.3.3 and earlier, this command would have an exit code of 1.

Step-by-step reproduction instructions (by running brew commands)

In a terminal, run:
brew list --versions doesnotexist; echo $?
dinofx commented 2 months ago

Perhaps related to https://github.com/Homebrew/brew/pull/17442 ?