5179 Commits

Author SHA1 Message Date
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
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Mike McQuaid
c8732c6a94
Merge pull request #18001 from smsearcy/fix-fish-shellenv 2024-08-12 14:23:05 +01:00