249 Commits

Author SHA1 Message Date
Adrian Ho
5155c9073b update*: enforce sane symlinks setting
Otherwise, a global `core.symlinks = false` setting, likely in a WSL context, breaks Aliases and any other places that use symlinks.

Also enforce consistency in `git config` settings across instances.

Ref: https://github.com/Homebrew/homebrew-core/issues/112539
2022-10-08 22:03:37 +08:00
Rylan Polster
bfbb7a79bd
Improve brew update with HOMEBREW_INSTALL_FROM_API 2022-09-02 02:10:12 -04:00
Carlo Cabrera
72880dea35
Merge pull request #13586 from carlocab/git-fsmonitor 2022-07-29 04:28:15 +08:00
Carlo Cabrera
5e60d54e70
update: disable Git fsmonitor for all Homebrew repositories
Stopping the fsmonitor doesn't seem to work, so let's just prevent the
fsmonitor from watching our repositories.
2022-07-28 22:20:07 +08:00
Carlo Cabrera
c42169249e
cmd/update: stop fsmonitor after all Git operations complete
Also, skip the status check, as that doesn't really help us.
2022-07-28 22:02:31 +08:00
Alexander Bayandin
4e8cc524c5 Clean up GitHub headers 2022-07-24 11:44:16 +00:00
Carlo Cabrera
f9e8531924
cmd/update: stop Git's fsmonitor when needed
Git's fsmonitor daemon will prevent our update lock file from being
released if it is running before a `brew update`.

Let's fix that by stopping it whenever necessary so our update lock is
released upon completion.

Fixes #13521.
2022-07-20 18:18:12 +08:00
Bo Anderson
7390022b0e
cmd/update.sh: fix race condition reporting fetch failures 2022-07-01 17:35:34 +01:00
Rylan Polster
b63474398e
Always prefer loading from API when HOMEBREW_INSTALL_FROM_API is set 2022-06-17 13:54:05 -04:00
Rylan Polster
f724dde6bb
Fix style 2022-06-16 15:37:33 -04:00
Rylan Polster
98f8a86af3
Clarify TODO in brew update
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-06-16 15:34:04 -04:00
Rylan Polster
43f7fa4162
Update cached formula json file when needed 2022-06-14 16:11:23 -04:00
Bo Anderson
1d36c42fb7
Support offline usage under HOMEBREW_INSTALL_FROM_API 2022-06-14 16:06:05 -04:00
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
Bob Lail
c715ea7fd1 Document the --quiet flag on brew update 2022-05-04 10:52:19 -05: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
Rylan Polster
feb93167ad
Rename and fix Formatter:wrap to Formatter.format_help_text 2022-01-08 23:13:08 -05:00
XuehaiPan
cf7def0c68
style: apply shellcheck autofix 2021-11-08 03:07:25 +00:00
Michka Popoff
1cc7ca33c0
update: migrate everyone from linuxbrew-core to homebrew-core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-20 11:01:38 +01:00
Bob Lail
c3e48b004d
Add HOMEBREW_SSH_CONFIG_PATH
This allows specifying the path of an SSH config file that Homebrew should use instead of the default, `~/.ssh/config`, when fetching Git repos over SSH.
2021-10-20 09:01:57 +01:00
Michka Popoff
e8ee5b05f9
Migrate linuxbrew-core to homebrew-core on update.
- Only for HOMEBREW_DEVELOPER
- Except for HOMEBREW_CORE_MERGE_MAINTAINER
- Except for GitHub Actions CI

Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-11 21:04:58 +02:00
Bo Anderson
6145036525
Redetermine curl and git paths where necessary 2021-10-05 17:13:47 +01:00
Bo Anderson
0ba222ccf2
cmd/update.sh: don't absorb ca-certificates installation failure 2021-10-04 14:26:49 +01:00
Bo Anderson
ebc0783c5f
Merge pull request #12167 from Bo98/brewed-curl-old-macos
Install and use Homebrew's `ca-certificates` on macOS <= 10.15.5
2021-10-04 05:29:57 +01:00
Bo Anderson
30b24cf4ad
Use HOMEBREW_CURL universally, including formulae 2021-10-04 02:03:04 +01:00
Bo Anderson
1952d27ba2
Install and use Homebrew's ca-certificates on macOS <= 10.15.5 2021-10-03 17:52:10 +01:00
XuehaiPan
43377a3e5e style: fix inconsistent code style for shell scripts by runing brew style --fix 2021-09-16 01:08:02 +08:00
XuehaiPan
bd8db0737d style: fix inconsistent code style for shell scripts 2021-09-16 01:06:19 +08:00
XuehaiPan
3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
Rylan Polster
99635bf3ae
Remove need for homebrew/cask to be tapped 2021-08-14 16:17:26 -04:00
Rylan Polster
a0f7711ab6
update: don't update homebrew/core for preinstall if using JSON 2021-07-14 02:13:23 -04:00
Gautham Goli
e4118bc4ca Fix shellcheck style errors 2021-05-18 17:10:20 +05:30
hyuraku
740cf7b6a1 cmd/update.sh: repair bash style 2021-05-06 10:03:16 +09:00
Mike McQuaid
7af68d0f8e
Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.

To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
  read sourced files every time
- disable some more warnings/errors we don't care about fixing
2021-04-22 13:18:44 +01:00
Darren Kavanagh
40d09f59b6
Replace tab with spaces and align indent 2021-03-18 11:31:42 -07:00
Darren Kavanagh
b66b461811
Expand quiet checks in update and update-report 2021-03-13 10:08:06 -08:00
Rylan Polster
84fc16c1c1
Apply suggestions from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2021-01-28 09:10:14 -05:00
Rylan Polster
f508f8dc0c
update: show message prompting brew tap --repair
This message is shown when a fetch fails due to a branch rename
2021-01-28 09:10:13 -05:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
EricFromCanada
a427de5bee capitalization fixes
"curl" is the binary, while "cURL" is the umbrella project.
2021-01-26 15:36:44 -05:00
Viktor Szakats
89eecedbbb
cmd/update: suppress curl warning in certain envs
Specifically the warning:
`Failed to set filetime <unixtime> on outfile: Operation not permitted`
when the user's `.curlrc`  contains `--remote-time` and the server 
returned a `Last-Modified:` header, like in case of the GitHub API.
2021-01-25 19:58:41 +01:00
Mike McQuaid
e2f998d3e6
Move HOMEBREW_AUTO_UPDATE_SECS default definition
This ensure it'll always be set to a value.

Fixes https://github.com/Homebrew/brew/issues/10386
2021-01-21 13:19:06 +00:00
Rylan Polster
34a88a3bb0 update: add notice that unshallowing takes time 2020-12-28 17:18:27 -05:00
J Rob Gant
54546c5f8f
Update Library/Homebrew/cmd/update.sh
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
2020-12-11 19:27:54 -05:00
J Rob Gant
68e2e48b63
Update the variable names 2020-12-11 12:47:47 -05:00
J Rob Gant
e0c1f9d9d1
Better newlines 2020-12-11 12:43:23 -05:00
J Rob Gant
290179091a
If the eariler code produced multiple messages I wouldn't have complained. 2020-12-10 13:22:15 -05:00
J Rob Gant
e084ba762c
fix typo 2020-12-10 11:20:46 -05:00