5401 Commits

Author SHA1 Message Date
“Vidisha
4403280211 cmd/list: fix duplicate casks when symlinks exist
When a cask is renamed (e.g. logi-options-plus to logi-options+),
Homebrew creates a symlink in the Caskroom directory. Currently,
`brew list --cask` shows both the original and symlinked cask as
separate entries. This patch modifies the listing logic to resolve
symlinks and show only unique casks.

Fixes #18849
2024-12-16 22:20:29 -08:00
apainintheneck
8bee0555b9 cask/info: send missing args after removing openstruct
This seems like it was a bug before the recent change to remove
OpenStruct from `Homebrew::CLI::Args` but it was failing silently
before. Now we pass the args to the `Cask::Info.info` method so
that when they eventually reach the `Utils::Analytics.output_analytics`
method they are present as expected.

Example error fragment:

```console
$ set -e HOMEBREW_NO_ANALYTICS
$ brew info iterm2 --cask --verbose
==> iterm2: 3.5.10 (auto_updates)
https://iterm2.com/
Installed
/usr/local/Caskroom/iterm2/3.5.4 (91.7MB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/i/iterm2.rb
==> Name
iTerm2
==> Description
Terminal emulator as alternative to Apple's Terminal app
==> Artifacts
iTerm.app (App)
Error: undefined method `analytics?' for an instance of Homebrew::CLI::Args
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:248:in `output_analytics'
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:342:in `cask_output'
/usr/local/Homebrew/Library/Homebrew/cask/info.rb:39:in `info'
```
2024-12-11 23:24:22 -08:00
Douglas Eichelberger
563c2b1d3a
Merge pull request #18847 from Homebrew/no-ostruct
Remove OpenStruct from CLI::Args
2024-12-11 18:41:13 +00:00
Ruoyu Zhong
a50e15e43c
cmd/list: support using --full-name with --installed-on-request et al.
Fixes https://github.com/Homebrew/brew/issues/18908#issuecomment-2532926860.
2024-12-11 11:27:08 +08:00
Douglas Eichelberger
3a4243742f Remove OpenStruct from CLI::Args 2024-12-08 10:27:49 -08:00
Douglas Eichelberger
ad70bcbbe0
Merge pull request #18867 from Homebrew/typed-named-args
Enable strict typing in NamedArgs
2024-12-04 08:49:46 -08:00
Douglas Eichelberger
e1fdd2eda4 Enable strict typing in NamedArgs 2024-12-03 17:43:22 -08:00
Carlo Cabrera
4029e3d7c1
cmd/update: avoid switching developers to stable branch
Checking for `HOMEBREW_NO_INSTALL_CLEANUP` was added in #18825, but this
breaks developers by switching them to the stable branch.

Setting `HOMEBREW_NO_UPDATE_CLEANUP` when `HOMEBREW_NO_INSTALL_CLEANUP`
is set seems like a relatively recent addition, so I don't think it
hurts to just remove it. We can add it back (correctly) if there are
users that need it.
2024-12-04 01:32:52 +08:00
Mike McQuaid
58e72b0a7f
Merge pull request #18856 from Homebrew/fix_brew_developer 2024-12-03 15:41:13 +00:00
Mike McQuaid
fc40424f0e
cmd/update-reset: remove .git/describe-cache.
As this is a cache and can potentially be incorrect, let's allow this
way of cleaning it up.
2024-12-03 14:30:14 +00:00
Mike McQuaid
5f82dd1880
cmd/developer: fix HOMEBREW_UPDATE_TO_TAG handling.
The handling of `HOMEBREW_UPDATE_TO_TAG` was incorrect as it implied it
also enabled developer mode whereas the opposite was true.
2024-12-03 09:08:50 +00:00
Eric Knibbe
1ed026c91a
update.sh: fix unused environment variable 2024-11-25 22:43:48 -05:00
Mike McQuaid
56780f3355
Merge pull request #18806 from Homebrew/rm-uses-ostruct
Remove OpenStruct from Uses cmd
2024-11-25 08:51:07 +00:00
Eric Knibbe
51be1d9652
revert setting --insecure to download ca-certificates 2024-11-24 14:57:32 -05:00
Douglas Eichelberger
cb1c49e06b Fix sigs 2024-11-23 10:25:45 -08:00
Douglas Eichelberger
89e640c567 Remove OpenStruct from Uses cmd 2024-11-22 21:04:51 -08:00
Mike McQuaid
4d4531c19d
Revamp installed_on_request handling
- `reinstall` and `upgrade` no longer mark as installed on request,
  with or without names specified, but preserve the version from the
  tab instead
- default `install_on_request` to `false` rather than `true`
- only set installed in request in a tab if it's missing rather than
  false

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2024-11-19 08:39:55 +00:00
Douglas Eichelberger
ebe1e504da Change command output instead 2024-11-07 11:26:19 -08:00
Douglas Eichelberger
c17ffb8c3b Try matching key type 2024-11-07 09:24:50 -08:00
Mike McQuaid
e7159d733c
Revert "cmd/shellenv: set XDG_DATA_DIRS on Linux" 2024-10-30 18:27:54 -07:00
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