Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS environment variable #9477

Merged
merged 1 commit into from Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Library/Homebrew/cleanup.rb
Expand Up @@ -2,6 +2,7 @@
# frozen_string_literal: true

require "utils/bottles"

require "utils/gems"
require "formula"
require "cask/cask_loader"
Expand All @@ -12,7 +13,7 @@ module Homebrew
#
# @api private
class Cleanup
CLEANUP_DEFAULT_DAYS = 30
CLEANUP_DEFAULT_DAYS = Homebrew::EnvConfig.cleanup_periodic_full_days.to_i.freeze
private_constant :CLEANUP_DEFAULT_DAYS

# {Pathname} refinement with helper functions for cleaning up files.
Expand Down
8 changes: 7 additions & 1 deletion Library/Homebrew/env_config.rb
Expand Up @@ -68,6 +68,11 @@ module EnvConfig
"`~/.profile`, `~/.bash_profile`, or `~/.zshenv`:\n\n" \
' `export HOMEBREW_CASK_OPTS="--appdir=~/Applications --fontdir=/Library/Fonts"`',
},
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: {
description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will cleanup all formulae " \
"when this number of days has passed.",
default: 30,
},
HOMEBREW_CLEANUP_MAX_AGE_DAYS: {
description: "Cleanup all cached files older than this many days.",
default: 120,
Expand Down Expand Up @@ -243,7 +248,8 @@ module EnvConfig
},
HOMEBREW_NO_INSTALL_CLEANUP: {
description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \
"cleanup installed/upgraded/reinstalled formulae or all formulae every 30 days.",
"cleanup installed/upgraded/reinstalled formulae or all formulae every " \
"HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days.",
boolean: true,
},
HOMEBREW_PRY: {
Expand Down
7 changes: 6 additions & 1 deletion docs/Manpage.md
Expand Up @@ -1683,6 +1683,11 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just

`export HOMEBREW_CASK_OPTS="--appdir=~/Applications --fontdir=/Library/Fonts"`

- `HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS`
<br>If set, `brew install`, `brew upgrade` and `brew reinstall` will cleanup all formulae when this number of days has passed.

*Default:* `30`.

- `HOMEBREW_CLEANUP_MAX_AGE_DAYS`
<br>Cleanup all cached files older than this many days.

Expand Down Expand Up @@ -1819,7 +1824,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Note:* While ensuring your downloads are fully secure, this is likely to cause from-source SourceForge, some GNU & GNOME-hosted formulae to fail to download.

- `HOMEBREW_NO_INSTALL_CLEANUP`
<br>If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every 30 days.
<br>If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days.

- `HOMEBREW_PRY`
<br>If set, use Pry for the `brew irb` command.
Expand Down
11 changes: 10 additions & 1 deletion manpages/brew.1
Expand Up @@ -2356,6 +2356,15 @@ Append these options to all \fBcask\fR commands\. All \fB\-\-*dir\fR options, \f
\fBexport HOMEBREW_CASK_OPTS="\-\-appdir=~/Applications \-\-fontdir=/Library/Fonts"\fR
.
.TP
\fBHOMEBREW_CLEANUP_PERIODIC_FULL_DAYS\fR
.
.br
If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will cleanup all formulae when this number of days has passed\.
.
.IP
\fIDefault:\fR \fB30\fR\.
.
.TP
\fBHOMEBREW_CLEANUP_MAX_AGE_DAYS\fR
.
.br
Expand Down Expand Up @@ -2614,7 +2623,7 @@ If set, forbid redirects from secure HTTPS to insecure HTTP\.
\fBHOMEBREW_NO_INSTALL_CLEANUP\fR
.
.br
If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every 30 days\.
If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days\.
.
.TP
\fBHOMEBREW_PRY\fR
Expand Down