5331 Commits

Author SHA1 Message Date
apainintheneck
200452e23d cmd/upgrade: required named args when upgrading from source
The --build-from-source flag can currently be used without specifying
a formula by name but it doesn't behave the way you'd expect it to.

It will upgrade everything using bottles if they are available and skip
building things from source. This is intentional because we want to
discourage non-developers from building packages from source since the
result is less predictable.

The change here is to error out in that case. It might be smarter to
go through the entire deprecation cycle here just in case someone
is using this in scripts.
2024-10-14 20:49:04 -07:00
Conlan Cesar
f7b8681bc9
Add zsh site-functions to fpath
I considered doing a fallthough in the case-statement, but that doesn't work on bash leq 4 (notably, those versions shipped with MacOS by default).

I chose to prepend the value to the array to mirror the homebrew completion [instructions page](https://docs.brew.sh/Shell-Completion).

I also chose to leave off the `-d`irectory check -- zsh seems to tolerate invalid paths, so there isn't much harm in adding it anyway.

I'm flexible on any of these choices should someone feel strongly. However, I imagine this is the best combination given the trade-offs we have.
2024-10-15 03:20:50 +08:00
Mike McQuaid
d1e539cb84
Merge pull request #18547 from Homebrew/cask-formula-dep-preinstall
Perform preinstall checks when a formula is installed via a cask
2024-10-13 17:40:59 +01:00
Bob Lail
a5db113d91 feat: Install an unlinked formula via brew install if --overwrite is passed
If the intention is to overwrite any existing links, then `brew install` should go on to install over an unlinked formula
2024-10-12 11:50:51 -07:00
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Patrick Linnane
c2e2b23c50
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-10-02 10:03:12 -07:00
Mike McQuaid
54d484d428
Merge pull request #18464 from benknoble/bk/tap-info-commit
feat(tap-info): display Git information about non-Core/non-API taps
2024-10-01 09:25:44 +01:00
D. Ben Knoble
3429e74d7e feat(tap-info): display Git information about non-Core/non-API taps
Copy and tweak code from Library/Homebrew/system_config.rb:110 to commit
and date information. This information can be useful when debugging
formulae in custom taps to ensure the tap has been correctly updated
recently or to suss out important differences from one version of a tap
to another.

This removes the need to ask users to run something like

    git -C $(brew --repository)/Library/Taps/<tap> show -s --decorate

Close https://github.com/Homebrew/brew/issues/18381
2024-09-30 11:27:35 -04:00
Michael Cho
4c60dc0b2c
cmd/list: -t and -r support for some long options 2024-09-26 20:01:44 -04:00
Mike McQuaid
05cde76adc
Merge pull request #18422 from Homebrew/cmd-cache-touchup
cmd/--cache: avoid exception on missing HEAD
2024-09-26 16:18:10 +01:00
Michael Cho
55fab8849c
caveats: typed: strict 2024-09-26 10:30:21 -04:00
Michael Cho
b1de5a22d2
cmd/--cache: avoid exception on missing HEAD
Also add cask to description
2024-09-26 09:49:30 -04:00
Mike McQuaid
e030625eb4
Merge pull request #18172 from cho-m/brew-info-size
cmd/info: show size information
2024-09-25 14:02:38 +01:00
Michael Cho
ea0776c425
cmd/info: show size information
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-09-25 08:56:33 +01:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
notfirefox
12982a2d97 cmd/shellenv: set XDG_DATA_DIRS on Linux
Some programs like `vapigen` might not work correctly, when `XDG_DATA_DIRS`
does not include `$HOMEBREW_PREFIX/share`. Instead of requiring the user
to manually adjust the shell environment, we can set `XDG_DATA_DIRS` as
part of `cmd/shellenv`, so that it is sufficient to run `brew shellenv`
on any particular system.

Fixes #18317
2024-09-17 13:54:53 +02:00
Carlo Cabrera
623e1766dd
cmd/shellenv: use long flags for fish
This will make the output more readable. We tend to prefer long flags
elsewhere anyway.
2024-09-12 16:49:23 +08:00
WinkelCode
d6043f1554 shellenv.sh: Move fish PATHs to front if they exist 2024-09-10 22:46:17 +02:00
Carlo Cabrera
4f03226a10
shellenv: silence errors from writing to HOMEBREW_PATHS_FILE
Fixes #18301.
2024-09-11 03:26:54 +08:00
Markus Reiter
b68ee4142f
Ensure thread-pool shutdown. 2024-09-07 14:45:30 +02:00
Markus Reiter
69a04bd249
Fix code style. 2024-09-05 18:11:49 +02:00
Markus Reiter
c61713b8e0
Fix handling for --retry flag. 2024-09-05 17:14:40 +02:00
Markus Reiter
231ac720d2
Add FIXME comment. 2024-09-04 22:54:30 +02:00
Markus Reiter
9fd4c97fac
Add method for moving cursor up and to the beginning. 2024-09-04 22:54:29 +02:00
Markus Reiter
984cde114a
Move escape codes to Tty. 2024-09-04 22:54:28 +02:00
Markus Reiter
404176af1d
Implement Downloadable for more types. 2024-09-04 22:54:28 +02:00
Markus Reiter
e7c9049a3c
Use futures instead of promises. 2024-09-04 22:54:27 +02:00
Markus Reiter
d6ebb04ff5
Improve output. 2024-09-04 22:54:27 +02:00
Markus Reiter
0b50f0651e
Fix code style. 2024-09-04 22:54:26 +02:00
Markus Reiter
3b5b669b61
Improve output. 2024-09-04 22:54:24 +02:00
Markus Reiter
6434533ff5
Remove Whirly and show concurrent downloads. 2024-09-04 22:54:24 +02:00
Markus Reiter
3a51f55572
Move require. 2024-09-04 22:54:23 +02:00
Markus Reiter
601134b047
Fix --force flag. 2024-09-04 22:54:22 +02:00
Markus Reiter
b55528b825
Color status. 2024-09-04 22:54:21 +02:00
Markus Reiter
b297be77a1
Implement concurrent downloads. 2024-09-04 22:54:20 +02:00
Bo Anderson
99ce3094e9
Invalidate Bootsnap cache on Gemfile.lock changes 2024-09-04 04:05:10 +01:00
Carlo Cabrera
1981abd959
Merge pull request #18225 from Homebrew/revert-18224-revert-18188-better-shellenv 2024-09-03 16:03:22 +08:00
Michael Cho
a548a81040
docs: remove references to deprecated/disabled GCC formulae 2024-09-02 12:03:06 -04:00
Carlo Cabrera
9d60472090
shellenv: retain user PATH
This is filtered in `brew`, so we need to manually set this to
`HOMEBREW_PATH`.
2024-09-02 21:12:36 +08:00
Carlo Cabrera
c9ca7e3257
cmd/shellenv: output the result of path_helper instead
This will save the indirection of `eval`.
2024-09-02 17:36:17 +08:00
Carlo Cabrera
43d10940b9
Revert "Revert "cmd/shellenv: improve for newer macOS using /usr/libexec/path_helper"" 2024-09-02 17:32:05 +08:00
Carlo Cabrera
121624e0c2
Revert "cmd/shellenv: improve for newer macOS using /usr/libexec/path_helper" 2024-09-02 17:02:08 +08:00
Carlo Cabrera
6cd74705cb
shellenv: silence errors from writing to etc/paths file
Users don't need to see this error. We can just fall back silently
instead.
2024-08-29 19:12:23 +08:00
Carlo Cabrera
04088b3e3c
shellenv: extract paths file to a variable
Let's follow the Rule of Three here.
2024-08-29 17:36:50 +08:00
Carlo Cabrera
6dc90cbf83
cmd/shellenv: improve for newer macOS using /usr/libexec/path_helper
On macOS 14 and newer, `/usr/libexec/path_helper` supports setting a
`PATH_HELPER_ROOT` environment variable.

With this set, `path_helper` checks `$PATH_HELPER_ROOT/etc/paths` and
`$PATH_HELPER_ROOT/etc/paths.d` in the same way it checks `/etc/paths`
and `/etc/paths.d`.

We can use this to simplify management of the user's `PATH` variable
when they do `brew shellenv`. In particular, if their system supports
it, we delegate setting the `PATH` environment variable to `path_helper`
instead of our own code. We also write a default `etc/paths` file if one
is not already present.

This is nicer because it simplifies management of the user's `PATH`
variable. For example, if a user wants a keg-only formula to be in their
`PATH`, they can simply add the necessary path to `/etc/paths` or
`/etc/paths.d` without having to do something like `brew link --force`
or adding to `PATH` themselves.

When `/usr/libexec/path_helper` is not available, we just fall back to
the existing code.
2024-08-29 17:00:43 +08:00
Mike McQuaid
9ee471d42c
Merge pull request #18133 from FnControlOption/ls 2024-08-23 08:06:49 +01:00
Bo Anderson
98fb5f9dea
Don't assume ENV is a superenv in RBI 2024-08-23 05:59:00 +01:00
fn ⌃ ⌥
6287607ac5 cmd/list: add --poured-from-bottle and --built-from-source 2024-08-22 21:26:16 -07:00
Bo Anderson
77204e01da
reinstall: move to submodule 2024-08-20 03:58:01 +01:00
Douglas Eichelberger
fb2fdc5249 Minor type safety improvements 2024-08-18 18:16:39 -07:00