Further adjust HOMEBREW_AUTO_UPDATE_SECS

Add another case to update once an hour when developer commands have
been run.
This commit is contained in:
Mike McQuaid 2023-02-15 17:37:12 +00:00
parent ba06013f72
commit f39ab585b9
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829
5 changed files with 10 additions and 5 deletions

View File

@ -41,7 +41,7 @@ Metrics/PerceivedComplexity:
Metrics/MethodLength:
Max: 232
Metrics/ModuleLength:
Max: 480
Max: 481
Exclude:
# TODO: extract more of the bottling logic
- "dev-cmd/bottle.rb"

View File

@ -270,6 +270,10 @@ auto-update() {
then
# 24 hours
HOMEBREW_AUTO_UPDATE_SECS="86400"
elif [[ -n "${HOMEBREW_DEV_CMD_RUN}" ]]
then
# 1 hour
HOMEBREW_AUTO_UPDATE_SECS="3600"
else
# 5 minutes
HOMEBREW_AUTO_UPDATE_SECS="300"

View File

@ -47,7 +47,8 @@ module Homebrew
description: "Run `brew update` once every `HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, " \
"e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, " \
"disable auto-update entirely with `HOMEBREW_NO_AUTO_UPDATE`.",
default_text: "86400 (24 hours) or 300 (5 minutes) if `HOMEBREW_NO_INSTALL_FROM_API` is set.",
default_text: "86400 (24 hours), 3600 (1 hour) if a developer command has been run " \
"or 300 (5 minutes) if `HOMEBREW_NO_INSTALL_FROM_API` is set.",
},
HOMEBREW_AUTOREMOVE: {
description: "If set, calls to `brew cleanup` and `brew uninstall` will automatically " \

View File

@ -10,7 +10,7 @@ brew(1) -- The Missing Package Manager for macOS (or Linux)
Homebrew is the easiest and most flexible way to install the UNIX tools Apple
didn't include with macOS. It can also install software not packaged for your
Linux distribution without requiring `sudo`.
Linux distribution to your home directory without requiring `sudo`.
## TERMINOLOGY
@ -2003,7 +2003,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
- `HOMEBREW_AUTO_UPDATE_SECS`
<br>Run `brew update` once every `HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, disable auto-update entirely with `HOMEBREW_NO_AUTO_UPDATE`.
*Default:* 86400 (24 hours) or 300 (5 minutes) if `HOMEBREW_NO_INSTALL_FROM_API` is set.
*Default:* 86400 (24 hours), 3600 (1 hour) if a developer command has been run or 300 (5 minutes) if `HOMEBREW_NO_INSTALL_FROM_API` is set.
- `HOMEBREW_AUTOREMOVE`
<br>If set, calls to `brew cleanup` and `brew uninstall` will automatically remove unused formula dependents and if `HOMEBREW_NO_INSTALL_CLEANUP` is not set, `brew cleanup` will start running `brew autoremove` periodically.

View File

@ -2864,7 +2864,7 @@ Check Homebrew\'s API for new formulae or cask data every \fBHOMEBREW_API_AUTO_U
Run \fBbrew update\fR once every \fBHOMEBREW_AUTO_UPDATE_SECS\fR seconds before some commands, e\.g\. \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew tap\fR\. Alternatively, disable auto\-update entirely with \fBHOMEBREW_NO_AUTO_UPDATE\fR\.
.
.IP
\fIDefault:\fR 86400 (24 hours) or 300 (5 minutes) if \fBHOMEBREW_NO_INSTALL_FROM_API\fR is set\.
\fIDefault:\fR 86400 (24 hours), 3600 (1 hour) if a developer command has been run or 300 (5 minutes) if \fBHOMEBREW_NO_INSTALL_FROM_API\fR is set\.
.
.TP
\fBHOMEBREW_AUTOREMOVE\fR