Merge pull request #3913 from MikeMcQuaid/upgrade-cleanup-env

upgrade: add HOMEBREW_UPGRADE_CLEANUP variable.
This commit is contained in:
Mike McQuaid 2018-03-12 11:39:00 +00:00 committed by GitHub
commit 92d6437d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

View File

@ -3,7 +3,8 @@
#: #:
#: Options for the `install` command are also valid here. #: Options for the `install` command are also valid here.
#: #:
#: If `--cleanup` is specified then remove previously installed <formula> version(s). #: If `--cleanup` is specified or `HOMEBREW_UPGRADE_CLEANUP` is set then remove
#: previously installed <formula> version(s).
#: #:
#: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if #: If `--fetch-HEAD` is passed, fetch the upstream repository to detect if
#: the HEAD installation of the formula is outdated. Otherwise, the #: the HEAD installation of the formula is outdated. Otherwise, the
@ -82,7 +83,7 @@ module Homebrew
Migrator.migrate_if_needed(f) Migrator.migrate_if_needed(f)
begin begin
upgrade_formula(f) upgrade_formula(f)
next unless ARGV.include?("--cleanup") next if !ARGV.include?("--cleanup") && !ENV["HOMEBREW_UPGRADE_CLEANUP"]
next unless f.installed? next unless f.installed?
Homebrew::Cleanup.cleanup_formula f Homebrew::Cleanup.cleanup_formula f
rescue UnsatisfiedRequirements => e rescue UnsatisfiedRequirements => e

View File

@ -242,6 +242,9 @@ can take several different forms:
This issue typically occurs when using FileVault or custom SSD This issue typically occurs when using FileVault or custom SSD
configurations. configurations.
* `HOMEBREW_UPGRADE_CLEANUP`:
If set, `brew upgrade` always assumes `--cleanup` has been passed.
* `HOMEBREW_VERBOSE`: * `HOMEBREW_VERBOSE`:
If set, Homebrew always assumes `--verbose` when running commands. If set, Homebrew always assumes `--verbose` when running commands.

View File

@ -554,7 +554,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
Options for the `install` command are also valid here. Options for the `install` command are also valid here.
If `--cleanup` is specified then remove previously installed `formula` version(s). If `--cleanup` is specified or `HOMEBREW_UPGRADE_CLEANUP` is set then remove
previously installed `formula` version(s).
If `--fetch-HEAD` is passed, fetch the upstream repository to detect if If `--fetch-HEAD` is passed, fetch the upstream repository to detect if
the HEAD installation of the formula is outdated. Otherwise, the the HEAD installation of the formula is outdated. Otherwise, the
@ -1092,6 +1093,9 @@ can take several different forms:
This issue typically occurs when using FileVault or custom SSD This issue typically occurs when using FileVault or custom SSD
configurations. configurations.
* `HOMEBREW_UPGRADE_CLEANUP`:
If set, `brew upgrade` always assumes `--cleanup` has been passed.
* `HOMEBREW_VERBOSE`: * `HOMEBREW_VERBOSE`:
If set, Homebrew always assumes `--verbose` when running commands. If set, Homebrew always assumes `--verbose` when running commands.

View File

@ -570,7 +570,7 @@ Upgrade outdated, unpinned brews (with existing install options)\.
Options for the \fBinstall\fR command are also valid here\. Options for the \fBinstall\fR command are also valid here\.
. .
.IP .IP
If \fB\-\-cleanup\fR is specified then remove previously installed \fIformula\fR version(s)\. If \fB\-\-cleanup\fR is specified or \fBHOMEBREW_UPGRADE_CLEANUP\fR is set then remove previously installed \fIformula\fR version(s)\.
. .
.IP .IP
If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\'s HEAD will be checked for updates when a new stable or devel version has been released\. If \fB\-\-fetch\-HEAD\fR is passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated\. Otherwise, the repository\'s HEAD will be checked for updates when a new stable or devel version has been released\.
@ -1111,6 +1111,10 @@ If set, instructs Homebrew to use \fBHOMEBREW_TEMP\fR as the temporary directory
This issue typically occurs when using FileVault or custom SSD configurations\. This issue typically occurs when using FileVault or custom SSD configurations\.
. .
.TP .TP
\fBHOMEBREW_UPGRADE_CLEANUP\fR
If set, \fBbrew upgrade\fR always assumes \fB\-\-cleanup\fR has been passed\.
.
.TP
\fBHOMEBREW_VERBOSE\fR \fBHOMEBREW_VERBOSE\fR
If set, Homebrew always assumes \fB\-\-verbose\fR when running commands\. If set, Homebrew always assumes \fB\-\-verbose\fR when running commands\.
. .