mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix HOMEBREW_*BREW_WRAPPER
behaviour
- handle reading from variables that may not be defined yet - avoid unnecessary handling of defined variables - fix incorrect `env_config.rbi` file entry - add `HOMEBREW_NO_FORCE_BREW_WRAPPER` to disable `HOMEBREW_FORCE_BREW_WRAPPER` functionality if needed
This commit is contained in:
parent
cbf92f31a8
commit
bb74d26a93
@ -182,8 +182,9 @@ esac
|
|||||||
source "${HOMEBREW_LIBRARY}/Homebrew/utils/helpers.sh"
|
source "${HOMEBREW_LIBRARY}/Homebrew/utils/helpers.sh"
|
||||||
|
|
||||||
# Require HOMEBREW_BREW_WRAPPER to be set if HOMEBREW_FORCE_BREW_WRAPPER is set
|
# Require HOMEBREW_BREW_WRAPPER to be set if HOMEBREW_FORCE_BREW_WRAPPER is set
|
||||||
# for all non-trivial commands (i.e. not run above).
|
# (and HOMEBREW_NO_FORCE_BREW_WRAPPER is not set) for all non-trivial commands
|
||||||
if [[ -n "${HOMEBREW_FORCE_BREW_WRAPPER}" ]]
|
# (i.e. not defined above this line e.g. formulae or --cellar).
|
||||||
|
if [[ -z "${HOMEBREW_NO_FORCE_BREW_WRAPPER:-}" && -n "${HOMEBREW_FORCE_BREW_WRAPPER:-}" ]]
|
||||||
then
|
then
|
||||||
if [[ -z "${HOMEBREW_BREW_WRAPPER:-}" ]]
|
if [[ -z "${HOMEBREW_BREW_WRAPPER:-}" ]]
|
||||||
then
|
then
|
||||||
@ -195,7 +196,7 @@ but HOMEBREW_BREW_WRAPPER was unset. This indicates that you are running
|
|||||||
directly but should instead run
|
directly but should instead run
|
||||||
${HOMEBREW_FORCE_BREW_WRAPPER}
|
${HOMEBREW_FORCE_BREW_WRAPPER}
|
||||||
EOS
|
EOS
|
||||||
elif [[ "${HOMEBREW_FORCE_BREW_WRAPPER:-}" != "${HOMEBREW_BREW_WRAPPER:-}" ]]
|
elif [[ "${HOMEBREW_FORCE_BREW_WRAPPER}" != "${HOMEBREW_BREW_WRAPPER}" ]]
|
||||||
then
|
then
|
||||||
odie <<EOS
|
odie <<EOS
|
||||||
HOMEBREW_FORCE_BREW_WRAPPER was set to
|
HOMEBREW_FORCE_BREW_WRAPPER was set to
|
||||||
|
@ -376,6 +376,10 @@ module Homebrew
|
|||||||
description: "If set, do not print any hints about changing Homebrew's behaviour with environment variables.",
|
description: "If set, do not print any hints about changing Homebrew's behaviour with environment variables.",
|
||||||
boolean: true,
|
boolean: true,
|
||||||
},
|
},
|
||||||
|
HOMEBREW_NO_FORCE_BREW_WRAPPER: {
|
||||||
|
description: "If set, disables `HOMEBREW_FORCE_BREW_WRAPPER` behaviour, even if set.",
|
||||||
|
boolean: true,
|
||||||
|
},
|
||||||
HOMEBREW_NO_GITHUB_API: {
|
HOMEBREW_NO_GITHUB_API: {
|
||||||
description: "If set, do not use the GitHub API, e.g. for searches or fetching relevant issues " \
|
description: "If set, do not use the GitHub API, e.g. for searches or fetching relevant issues " \
|
||||||
"after a failed install.",
|
"after a failed install.",
|
||||||
|
@ -142,8 +142,8 @@ module Homebrew::EnvConfig
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def force_api_auto_update?; end
|
def force_api_auto_update?; end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T.nilable(::String)) }
|
||||||
def force_brew_wrapper?; end
|
def force_brew_wrapper; end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def force_brewed_ca_certificates?; end
|
def force_brewed_ca_certificates?; end
|
||||||
@ -238,6 +238,9 @@ module Homebrew::EnvConfig
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def no_env_hints?; end
|
def no_env_hints?; end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def no_force_brew_wrapper?; end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def no_github_api?; end
|
def no_github_api?; end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user