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 support for Homebrew wrappers #19049

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Add support for Homebrew wrappers #19049

merged 1 commit into from
Jan 8, 2025

Conversation

MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Jan 7, 2025

Allow the ability for a system administrator to use HOMEBREW_BREW_WRAPPER and HOMEBREW_FORCE_BREW_WRAPPER variables to enforce the usage of a particular brew command for non-trivial (e.g. brew --prefix is considered trivial, it doesn't need to write to the prefix) Homebrew commands.

This also introduces a HOMEBREW_ORIGINAL_BREW_FILE variable for some internal usage; HOMEBREW_BREW_FILE was being used internally for both "how should we shell out to Homebrew" and "what should we use to check permissions on Homebrew". HOMEBREW_ORIGINAL_BREW_FILE is now used just for the latter case.

Inspired by conversation in Homebrew/homebrew-bundle#1551 which suggested this was worth fixing in wider than just brew bundle.

Base automatically changed from force_api_auto_update to master January 7, 2025 16:52
@MikeMcQuaid MikeMcQuaid requested review from carlocab and Bo98 and removed request for carlocab January 7, 2025 17:23
Library/Homebrew/brew.sh Outdated Show resolved Hide resolved
Allow the ability for a system administrator to use
`HOMEBREW_BREW_WRAPPER` and `HOMEBREW_FORCE_BREW_WRAPPER` variables to
enforce the usage of a particular `brew` command for non-trivial (e.g.
`brew --prefix` is considered trivial, it doesn't need to write to the
prefix) Homebrew commands.

This also introduces a `HOMEBREW_ORIGINAL_BREW_FILE` variable for some
internal usage; `HOMEBREW_BREW_FILE` was being used internally for
both "how should we shell out to Homebrew" and "what should we use
to check permissions on Homebrew". `HOMEBREW_ORIGINAL_BREW_FILE` is
now used just for the latter case.

Inspired by conversation in
Homebrew/homebrew-bundle#1551 which suggested
this was worth fixing in wider than just `brew bundle`.
@carlocab
Copy link
Member

carlocab commented Jan 8, 2025

Had a different approach: https://github.com/Homebrew/brew/compare/original-brew-command?expand=1

But the one here works for me too.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jan 8, 2025
Merged via the queue into master with commit cbf92f3 Jan 8, 2025
28 checks passed
@MikeMcQuaid MikeMcQuaid deleted the brew_wrapper branch January 8, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants