369 Commits

Author SHA1 Message Date
Mike McQuaid
71a4421c6c
cmd/install: add missing require.
Fixes #15748
2023-07-25 10:08:49 +01:00
apainintheneck
c9dea04bd4 cmd/install: upgrade already installed casks
Previously, the behavior was to warn users that a cask was already
installed and then skip modifying the installed version. This is
different to how we handled things with formulas. For them we would
upgrade any already installed formulas. This just brings casks in line
with what we already do with formulas.

Changes:
- cmd/install: Upgrade already installed casks if HOMEBREW_NO_INSTALL_UPGRADE
  is not set
- env_config: Update wording of HOMEBREW_NO_INSTALL_UPGRADE to include casks
- remove error that was only used to alert about already installed casks

Note:
- The upgrade command for casks defaults to --greedy when you pass named casks
  to the command which means that this will always default to that behavior
  since you must specify the name of the cask when installing.
2023-07-23 18:50:39 -07:00
Bo Anderson
beaa6c32a0
Fix cases of core taps being unnecessarily installed 2023-07-13 20:33:31 +01:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
apainintheneck
e82867a755 cmd/install: warn on cask install when already installed
This was the default behavior before #15273 got merged in to
refactor the `cask/cmd/install` logic into `cmd/install`.
2023-04-23 11:04:25 -07:00
hyuraku
c46ee85e0a remove args.quarantine? nil check 2023-04-19 23:15:12 +09:00
hyuraku
b2156dc125 add casks install to cmd/install 2023-04-19 21:31:22 +09:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Bo Anderson
3697825784
search: remove remote searching 2023-04-12 13:16:19 +01:00
Ruiyang Wu
007c896c97 Fix brew install --skip-post-install
Previous #15042 doesn't pass the flag all the way to
`FormulaInstaller.new`
2023-03-30 21:08:40 -04:00
Mike McQuaid
95a8c3f638
Add brew install --skip-post-install
Will be needed by `brew test-bot`.
2023-03-23 15:22:27 +00:00
Douglas Eichelberger
d56e2884aa Enable typing in cmd/ 2023-03-06 15:01:08 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Mike McQuaid
aaec4014fd
Merge pull request #14710 from issyl0/rubocop-excludes
rubocop: Clean up some `Exclude`s
2023-02-20 09:51:11 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00: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
apainintheneck
16f4a602b3 cmd/install: fail when pkg not found
The idea here is to facilitate scripting
by always failing whenever a package
is not installed successfully. This is
how the upgrade and reinstall commands
work but not install because we also
search for similar package names before
terminating.
2023-01-20 19:53:00 -08:00
apainintheneck
d291117468 Improve install cmd error msg
It now specifies casks, formulae or both in
theh output based upon the user args given.
2022-12-31 15:52:05 -08:00
apainintheneck
47b3f6fe6e Stop including/extending search.rb
- Instead use class methods.
- This is better than use it as a mixin
  when only a small number of methods are
  used in each class or module.
- It also allows us to conditionally
  require it in `brew install`.
- Removed unused search require in descriptions.rb.
2022-12-17 11:08:13 -08:00
apainintheneck
cb64bc4df3 Move pkg type logic into search_name
Now the search_name method takes the command line
args and only returns package types that line up
with those args.

That means it will only return casks if casks are valid
and same with formulae.
2022-12-13 22:50:00 -08:00
Kevin
0afc41ceef
Explain edge case in install/cmd
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-12-13 20:31:33 -08:00
apainintheneck
daa87fa10f Add specific examples to install cmd
- provide specific install instructions
  when a cask/formula doesn't exist
  and we search for similar ones
- print and exit early if a named formula that
  was removed recently has the same name
- exit early if the tap is specified because
  we don't get good search results
2022-12-12 21:04:59 -08:00
apainintheneck
a481729ade Show casks in install not found output
- Move `search_names` and `print_missing_formula_help` out of `cmd/search.rb` to `search.rb`
- Change to using those functions in `cmd/install.rb` when a formula or cask doesn't exist
2022-12-10 13:02:38 -08:00
Ian Gregory
a715dec49d Add --adopt switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.

Discussion: #14006
2022-10-21 23:28:51 -04:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
hyuraku
634fcad1b2 add dry-run option to formula#install 2022-08-16 21:01:07 +09:00
hyuraku
93ebe42a72 add dry-run option to cask#install 2022-08-16 21:00:45 +09: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
d35f2e76a7 Move Metrics/Blocklength disable to rubocop.yml 2022-08-02 09:06:28 -07:00
Lukas Oberhuber
5b1724ef33 Fix rubocop warning by ignoring for install_args 2022-08-01 15:27:17 -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
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Rylan Polster
b896f6cb0d
Allow more developer commands with HOMEBREW_INSTALL_FROM_API 2022-06-16 21:31:15 -04:00
Rylan Polster
1e536217b2
Streamline loading casks from API 2022-06-15 16:35:49 -04:00
Bob Lail
26ea79e1e6 Increase Metrics/BlockLength limit instead of disabling the cop for the block in install_args 2022-01-11 08:34:51 -06:00
Bob Lail
9b678c365b Add flag --overwrite to brew install to govern the keg-linking step
Allows you to avoid the `Keg::ConflictError` recommending that you invoke `brew link --overwrite` in scenarios when you know that that's how you'd proceed anyway.
2022-01-10 14:23:33 -06:00
Bo Anderson
6e37c67fba
Fix disabled args appearing in documentation. 2021-12-17 02:02:45 +00:00
Mike McQuaid
11c5f8f05a
Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:

- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents

For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
2021-11-25 09:10:59 +00:00
Rylan Polster
9fee68c500
Fix installing from API with tap names 2021-10-28 01:25:27 -04:00
Rylan Polster
7bb69e0b4c
Fix brew install with tap regex 2021-10-27 01:42:08 -04:00
hyuraku
e44ac800c2 repair cask install quiet mode 2021-09-10 23:12:52 +09:00
FnControlOption
eb16e10902 messages: record cask installations.
This is used to record installation times and also to determine
whether to display caveats.
2021-09-02 08:44:00 -07:00