175 Commits

Author SHA1 Message Date
thibhero
2fb6105f26 renaming variable 2025-06-20 12:29:02 -04:00
thibhero
19901b5332 refactoring style to resolve the last discussions 2025-06-18 16:05:19 -04:00
thibhero
fe06e04e28 refactoring install.rb and reinstall.rb after removing Formula.installed 2025-06-17 21:12:47 -04:00
thibhero
7e876e4681 resolving discussions 2025-06-11 22:35:00 -04:00
Mike McQuaid
dffa42839c
Merge branch 'master' into master 2025-06-11 13:24:46 +01:00
thibhero
aa47105d2a refactoring code 2025-06-09 00:14:16 -04:00
Eric Knibbe
3dc9e88542
parser: show related env var in switch description 2025-06-03 13:57:42 -04:00
thibhero
76e7a13332 applying brew tests, typecheck, style 2025-05-07 12:29:32 -04:00
thibhero
f875dbc8a7 Implementing ask input with casks
renamed `ask` to `ask_formulae`
moving option `--ask` to work with formulae and casks
2025-05-07 12:07:29 -04:00
Thibaut Hérault
548d87c9e8
Update Library/Homebrew/cmd/reinstall.rb comment
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-03-07 11:26:52 -05:00
thibhero
99fad7797c modifying files with brew style 2025-03-06 21:27:13 -05:00
thibhero
0b53e54bfa Moving ask input to Install.ask 2025-03-05 17:38:18 -05:00
thibhero
1a43a9d258 extracting method to Homebrew/install.rb 2025-02-18 22:41:40 -05:00
thibhero
bb7dcc9384 updating comments 2025-02-16 00:06:57 -05:00
thibhero
5c2bbe5911 pass brew typecheck, brew style and brew tests 2025-02-15 23:20:07 -05:00
thibhero
624e960cd5 refactoring lambda as upgrade.RB 2025-02-15 23:02:14 -05:00
thibhero
1ba3f32026 Adding upgrade arguments in lambda 2025-02-11 20:15:19 -05:00
thibhero
9891653aa8 corrected code with brew typecheck 2025-02-11 18:53:10 -05:00
thibhero
a111139682 moving to lambda expressions to respect brew style 2025-02-11 11:06:16 -05:00
thibhero
478035ed90 Copying function from upgrade.rb and implementing with check_dep: false 2025-02-10 23:18:47 -05:00
Mike McQuaid
bbf5a9f479
env_config: use environment variables consistently
- use e.g. `$HOMEBREW_*` for cases where only the environment variable
  is the entire backtick-quoted string
- use e.g. `${HOMEBREW_*}` for cases where the environment variable is
  part of a backtick-quoted string to make clear what parts are variable
  and what parts are not
- use `export HOMEBREW_*=...` for cases where we're talking about
  setting the environment variable (because it likely needs to be
  exported to work how they want)

Inspired by https://github.com/Homebrew/homebrew-bundle/pull/1579 making
similar changes for Homebrew/homebrew-bundle.
2025-01-27 14:21:27 +00:00
Douglas Eichelberger
e1fdd2eda4 Enable strict typing in NamedArgs 2024-12-03 17:43:22 -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
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Bo Anderson
77204e01da
reinstall: move to submodule 2024-08-20 03:58:01 +01:00
apainintheneck
52cf4e30fc Share attestation formula sorting and gh exe checking logic
This adds a new method to either move the `gh` formula to the front
of the formula list to be installed or checks that the `gh` formula
is already installed some other way.
2024-07-18 21:32:50 -07:00
apainintheneck
75cfa21068 Avoid frozen array errors in brew upgrade
The `Homebrew::CLI::NamedArgs` class often returns frozen arrays so this one cannot
be easily modified in-place here. We just overwrite it instead.

I also updated the `brew reinstall` command logic to match for consistency.

```console
$ brew upgrade gh --verbose --debug
...
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading gh
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading gh
Error: can't modify frozen Array: [#<Formula gh (stable) /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/g/gh.rb>]
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:139:in `delete'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:139:in `run'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11481/lib/types/private/methods/call_validation.rb:270:in `bind_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11481/lib/types/private/methods/call_validation.rb:270:in `validate_call'
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11481/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/usr/local/Homebrew/Library/Homebrew/brew.rb:95:in `<main>'
```
2024-07-17 23:54:50 -07:00
Nanda H Krishna
8839ccfe72
Fix tests for attestations 2024-07-17 14:48:53 -04:00
Nanda H Krishna
d2d814414e
cmd/{install,reinstall,upgrade}: ensure that gh is installed 2024-07-17 14:48:52 -04:00
Todd Schulman
18e2a37d14 cmd: allow --display-times with --cask 2024-04-09 01:50:29 -04:00
Douglas Eichelberger
d875c970e9 Port Homebrew::Cmd::Reinstall 2024-04-01 10:09:48 -07:00
Eric Knibbe
e63b1f4da5
docs: monospace suggested values 2024-02-04 15:42:26 +01:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
hyuraku
a41a7c94d8 remove cask/cmd 2023-04-19 21:30:42 +09:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
hyuraku
ec0d492c09 move cask/cmd/reinstall to cask/reinstall 2023-04-10 22:07:06 +09:00
Mike McQuaid
253dca568c
Revert "move cask/cmd/reinstall" 2023-03-23 17:06:42 +00:00
hyuraku
31e49d96af move cask/cmd/reinstall to cask/reinstall 2023-03-23 22:50:03 +09:00
Douglas Eichelberger
d56e2884aa Enable typing in cmd/ 2023-03-06 15:01:08 -08:00
Mike McQuaid
fbdec8738d
Warn more when building from source
We warn sometimes when we tell people to build from source and it's
not supported but we don't actually warn non-developers when invoking
the various install commands so: let's start doing so.

While we're here, also update the existing messaging to reflect the fact
we're on Mastodon now too and we don't want maintainers being
individually bothered about errors either.

I've tried to balance having messages here vs. having them be so long
at the beginning of installation that they will be missed or be overly
obnoxious.
2023-02-17 16:10:38 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
46d727b475
HOMEBREW_INSTALL_FROM_API: various improvements.
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where relevant
- remove some duplicate checks
- better scope checks to just core tap formulae
2023-01-25 14:29:35 +00:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Mike McQuaid
04ff6a18f4
Tweak --debug-symbols description. 2022-08-12 09:34:51 +01:00
Lukas Oberhuber
3d60d610dd Merge branch 'master' into debug-symbols 2022-08-10 18:44:09 -10:00
fn ⌃ ⌥
71ab2f6e7a Run periodic cleanup after installing all packages 2022-08-04 07:46:31 -07:00
Lukas Oberhuber
215e545660 brew style 2022-07-26 19:28:30 +01:00
Lukas Oberhuber
d195f22522 Connecting up --debug-symbols flag
This connects the calling of dsymutil and the retention of temporary
files. Still need to connect compilation to flag.
2022-07-26 12:15:53 +01:00
Rylan Polster
b896f6cb0d
Allow more developer commands with HOMEBREW_INSTALL_FROM_API 2022-06-16 21:31:15 -04:00