4618 Commits

Author SHA1 Message Date
Mike McQuaid
fb4c9353bb
Improve updating behaviour
- Rename use of "preinstall" to "auto update". The original "preinstall"
  naming came from the fact that we used to only auto-update before
  `brew install` but now that it's many commands: this is more confusing
  than useful.
- Add `HOMEBREW_NO_UPDATE_REPORT_ONLY_INSTALLED` and remove
  `HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED`; the latter is now the default
  and the prior provides an opt-out for better output, performance and
  avoiding reading potentially untrusted formulae.
- Add `HOMEBREW_UPDATE_FORMULA_VERSION_CHECKS` and don't check formula
  versions by default for better performance by default.

Co-authored-by: Eric Knibbe <3324775+EricFromCanada@users.noreply.github.com>
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2022-05-19 11:04:20 -04:00
Bo Anderson
14870406e0
Merge pull request #13253 from xxyzz/delete-force-update
Add `--no-force-auto-update` option to `brew tap`
2022-05-11 03:23:17 +01:00
xxyzz
2e899da7c7
Add --no-force-auto-update option to brew tap
Enable this option to delete `homebrew.forceautoupdate` git config option
2022-05-11 07:17:17 +08:00
Alex Balgavy
b886b2d1f7
Remove mentions of nonexistent command brew diy
The output of `brew doctor` can mention a command `brew diy`, which no
longer exists.
2022-05-06 10:22:25 -04:00
Bob Lail
c715ea7fd1 Document the --quiet flag on brew update 2022-05-04 10:52:19 -05:00
Carlo Cabrera
c586aeffc8
cmd/info: use Formula.all
Fixes #13241.
2022-05-04 16:41:25 +08:00
Maxim Belkin
13735bc780
Apply Mike's suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-04-26 08:35:28 -07:00
Maxim Belkin
27a2dba340
update/update-reset: warn when no origin remote
Current situation with update.sh & update-reset.sh:

Upon creating a new tap and before adding remote 'origin' to it,
running `brew update` produces multiple cryptic error messages.
This change converts these cryptic Git messages into clear warnings
about absent remote 'origin'.

How to test:
1. Create a new tap using `brew tap-new`
2. Run `brew update`
2022-04-26 08:35:27 -07:00
apainintheneck
f811774cab Display old and new version numbers when updating 2022-04-14 11:58:19 -07:00
EricFromCanada
8a7f082b30
list: output only if installed casks are passed
Fixes #13139.
2022-04-13 10:50:50 -04:00
Issy Long
a8ce086844
Merge pull request #13116 from issyl0/reinstall-cask-zap
cask/reinstall: Support `--zap` for entirely purging cask files
2022-04-12 10:37:58 +01:00
Issy Long
0b6b2f04da
cask/reinstall: Support --zap for entirely purging cask files
- The `brew uninstall` command has `--zap`, so let's make `brew
  reinstall` have parity here for a better user experience. (Requested
  in issue 12983.)
- It feels weird that to get my new reinstall test to pass I had to add
  `--zap` to `cask/cmd/install.rb`, not `cask/cmd/reinstall.rb` to get
  the tests to pass. But the `brew reinstall --cask caffeine --zap`
  command worked fine all the time. The CLI argument parser from the
  test run was complaining about not knowing what `zap` was. As a
  result, `--zap` now shows up as a switch in `brew install --help`
  which I'm not 100% convinced is the desired UX. But I've edited the
  description accordingly to specify that it will only work on
  `reinstall` operations (and `--zap` on `install` is a no-op).

```
issyl0 at pictor in /opt/homebrew on reinstall-cask-zap
❯ brew reinstall --cask caffeine --zap
==> Downloading https://github.com/IntelliScape/caffeine/releases/download/1.1.3/Caffeine.dmg
Already downloaded: /Users/issyl0/Library/Caches/Homebrew/downloads/3d6ccfdd3b8d0ab37d1c2468d6e69078c2d31d3b12bf51947c4db21e5f376af2--Caffeine.dmg
==> Implied `brew uninstall --cask caffeine`
==> Backing App 'Caffeine.app' up to '/opt/homebrew/Caskroom/caffeine/1.1.3/Caffeine.app'
==> Removing App '/Applications/Caffeine.app'
==> Dispatching zap stanza
==> Trashing files:
~/Library/Application Support/com.intelliscapesolutions.caffeine
~/Library/Preferences/com.intelliscapesolutions.caffeine.plist
~/Library/Caches/com.intelliscapesolutions.caffeine
~/Library/HTTPStoages/com.intelliscapesolutions.caffeine.binarycookies
==> Removing all staged versions of Cask 'caffeine'
==> Installing Cask caffeine
==> Moving App 'Caffeine.app' to '/Applications/Caffeine.app'
🍺  caffeine was successfully installed!
```
2022-04-09 16:37:23 +01:00
Rylan Polster
dda9f75fca
fetch: only fetch runtime deps with HOMEBREW_INSTALL_FROM_API 2022-04-06 23:36:24 -04:00
Steve Hahn
f5696efc16 set prefer_loading_from_api for fetch 2022-04-05 10:09:52 -07:00
Eric Knibbe
b533b380e5
Merge pull request #13033 from EricFromCanada/cask-search-descriptions
desc, search: also search cask descriptions
2022-03-30 13:48:24 -04:00
Mike McQuaid
61976e0672
caskroom: add, use any_casks_installed?.
Add a new method for the two places we're checking if we have any
casks installed. This is much more performance and user friendly than
attempting to load every cask.

Fixes #13027
2022-03-30 17:25:00 +01:00
EricFromCanada
2fdc70c3bf
desc, search: also search cask descriptions 2022-03-30 11:23:55 -04:00
EricFromCanada
0850fcb24a
list: support long and verbose version listing for casks 2022-03-28 11:06:57 -04:00
hyuraku
0f546b0b3d cmd/deps: repair dot_code 2022-03-19 16:21:01 +09:00
Mike McQuaid
79891a7103
Update uses of Formula.all/Cask::Cask.all
Add some `--all` flags we'll eventually migrate to to ensure that we'll
eventually require their usage to read all formulae. Where we need to
do stuff later, add some comments.
2022-03-08 19:24:56 +00:00
Mike McQuaid
47f8636e7d
update-report: optimise update_report_only_installed code. 2022-02-28 09:58:20 +00:00
Mike McQuaid
d48a9337e4
Revert "update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on." 2022-02-28 09:54:12 +00:00
Mike McQuaid
dd8a245158
Merge pull request #12910 from Homebrew/update_report_only_installed_default
update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on.
2022-02-24 08:46:08 +00:00
Mike McQuaid
38e1b3d64b
Deprecations, disables, deletions for 3.4.0 2022-02-22 14:28:32 +00:00
Mike McQuaid
10d5266361
update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on.
This avoids reading formula files that the user hasn't explicitly
installed which both speeds up `brew update` and improves the security.
2022-02-22 10:01:24 +00:00
Mike McQuaid
04938efc24
Unify GitHub Packages authorization logic in brew.sh. 2022-01-27 15:44:34 +00:00
Thomas Vaillant
ad65d47bee
fix: take $HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN into account when installing portable ruby 2022-01-27 09:37:20 +00:00
Nanda H Krishna
b950ac3f6e
cmd/shellenv.sh: fix typo
Co-authored-by: Greg Myers <myersg86@gmail.com>
2022-01-15 17:27:49 -05: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
Rylan Polster
feb93167ad
Rename and fix Formatter:wrap to Formatter.format_help_text 2022-01-08 23:13:08 -05:00
Mike McQuaid
4b3f0719e9
Merge pull request #12678 from hyuraku/repair-cask-formulae-autoremove
repair cask formulae autoremove
2022-01-07 13:09:41 +00:00
hyuraku
1fd4c4d840 rename variables and repair style 2022-01-07 21:05:36 +09:00
hyuraku
37945a407e repair cask formulae autoremove 2022-01-06 22:33:27 +09:00
Mike McQuaid
3a709d36b2
Start process to remove Enumerable from Formula and Cask::Cask.
This is the first step to address
https://github.com/Homebrew/brew/issues/11292.
2022-01-03 14:59:10 +00:00
Mike McQuaid
60afbd761a
Merge pull request #12649 from neutric/update-cmd-cleanup
cmd/cleanup.rb: description style tweak
2021-12-31 13:24:07 +00:00
neutric
f426f1f51f cmd/cleanup.rb: description style tweak 2021-12-31 03:24:34 +01:00
Logicer
e7b71eef22 autoremove: Return when not removing 2021-12-31 11:51:18 +11:00
Mike McQuaid
0b14b6d76d
Merge pull request #12641 from hyuraku/cmd/autoremove_cask_dependencies
cmd/autoremove recognize cask dependencies
2021-12-30 13:29:37 +00:00
hyuraku
4fb6a84139 repair if condition and style 2021-12-29 23:07:11 +09:00
Mike McQuaid
510bc25db6
brew style -fix 2021-12-29 13:07:39 +00:00
hyuraku
65ddf19609 cmd/autoremove recognize cask dependencies 2021-12-28 11:48:58 +09:00
Mike McQuaid
d3252ec2a8
Merge pull request #12576 from thomvaill/fix-vendor-install-private-registry-token
Take `$HOMEBREW_DOCKER_REGISTRY_TOKEN` into account when installing portable-ruby
2021-12-17 14:27:54 +00:00
Bo Anderson
6e37c67fba
Fix disabled args appearing in documentation. 2021-12-17 02:02:45 +00:00
Thomas Vaillant
0266d77b0f fix: take $HOMEBREW_DOCKER_REGISTRY_TOKEN into account when installing portable Ruby 2021-12-16 18:50:58 +01:00
Carlo Cabrera
00137dda8e
Check that ${HOMEBREW_PREFIX}/bin is first in PATH 2021-12-09 20:50:47 +08:00
Carlo Cabrera
a62e88304b
shellenv: check that Homebrew's prefix precedes /usr/bin
Some setups (e.g. a default `tmux` session) will result in a user
starting multiple nested login shells. This is a problem for the way we
currently handle `shellenv` because a login shell invokes
`/usr/libexec/path_helper` which will prepend the contents of
`/etc/paths` and `/etc/paths.d` to `PATH`. In particular, the second
login shell will place `brew` further down the `PATH` than desired in a
non-`/usr/local` prefix, since `brew shellenv` will no longer produce
output the second time around.

Let's fix this by replacing the check that `brew` is in `PATH` with a
check that `${HOMEBREW_PREFIX}/bin` precedes `/usr/bin` in `PATH`.

Fixes #11851, #11883, Homebrew/discussions#2547.

See also:
- Homebrew/discussions#2237
- https://superuser.com/questions/544989/does-tmux-sort-the-path-variable
2021-12-09 20:50:22 +08:00
Julian Pawlowski
29f08603bf
Add support for PowerShell-preview package 2021-12-01 09:55:33 +01:00
Julian Pawlowski
cec3f2190a
Add shellenv template for PowerShell 2021-11-30 10:47:56 +01: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