14 Commits

Author SHA1 Message Date
Mike McQuaid
8adc188992
Import brew alias and brew unalias commands
Import these from the homebrew/aliases tap and deprecate that tap.

This required a little messing around with class/module/constant names
to get `brew tests` and `brew typecheck` to play nicely.

I added also added Sorbet type signatures and integration tests.
2025-02-07 14:31:50 +00:00
Rylan Polster
c023b70e8f
Mirror real installation directory structure for tests 2025-01-23 03:11:59 -05:00
Mike McQuaid
e9b4979f40
Add support for Homebrew wrappers
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
https://github.com/Homebrew/homebrew-bundle/pull/1551 which suggested
this was worth fixing in wider than just `brew bundle`.
2025-01-07 17:40:18 +00:00
Przemysław Kryger
ff03947ba0 Use @@HOMEBREW_PREFIX@@ for replacements in external patches 2024-10-23 16:51:01 +01:00
Przemysław Kryger
a03d65b5c9 Allow HOMEBREW_PREFIX replacement in external patches
This fixes #15925
2024-10-23 15:15:17 +01:00
Bo Anderson
326a71712f
Revert "Shorten brew tests temporary paths."
This reverts commit 27fb07c0fc622d3e010a8a9f6e0056fd09dc5b1f.
2024-09-27 01:55:26 +01:00
Carlo Cabrera
e03a9fd0be
tests: add an extra byte of randomness
Two bytes should hopefully be plenty.
2024-09-25 22:32:51 +08:00
Mike McQuaid
27fb07c0fc
Shorten brew tests temporary paths.
If you have `HOMEBREW_TEMP` set to a longer path (e.g. the user's
private temporary directory rather than `/private/tmp`), Sequoia will
error out on some tests when forking because the path is too long
(> 104 bytes).

To improve this situation let's:
- use a shorter path for `HOMEBREW_TEMP` by appending `/brew-tests` to
  the existing `HOMEBREW_TEMP` used outside of tests rather than
  creating nested temporary directories
- use the minimal amount of randomness to avoid collisions while
  allowing parallel tests
- use `squeeze` to remove any double slashes in the temporary path
2024-09-24 10:28:18 +01:00
apainintheneck
1fe16a5e35 Address feedback
- Move HOMEBREW_TAP_DIRECTORY to startup/config.rb because this file
holds more of the directory constants
- Rename `Commands.cmd_directories` to `Commands.tap_cmd_directories`
to better express that the commands come from taps

This file has the directory constants while the other one has regexes.
Just better organization.
2024-08-10 17:52:26 -07:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Douglas Eichelberger
4d32699f61 Placate rubocop 2023-03-14 23:01:09 -07:00
Bo Anderson
7d7083d0f3
Universally apply Ruby disable options 2022-11-05 01:58:12 +00:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00