-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
cleanup: allow users to specify formulae to skip cleaning #11931
Conversation
Review period will end on 2021-08-30 at 10:05:52 UTC. |
This allows users to set `HOMEBREW_NO_CLEANUP_FORMULAE` to a comma-separated list of formulae that `brew` will refuse to clean with `brew cleanup`. We currently allow a less granular version of this with `HOMEBREW_NO_INSTALL_CLEANUP`. All this changes is how much control users have over what is and isn't cleaned. Fixes #11924.
Review period ended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One optional comment/thought.
def skip_clean_formula?(f) | ||
return false if Homebrew::EnvConfig.no_cleanup_formulae.blank? | ||
|
||
skip_clean_formulae = Homebrew::EnvConfig.no_cleanup_formulae.split(",") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's worth adding this behaviour into EnvConfig
itself under the type
? We also seem to alternate between comma and space separated on our configuration; might be worth doubling down on one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually also have an option that takes a path to a file that specifies the list. We should probably only pick one approach, but this will require a deprecation cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or: we support both space-separated and comma-separated in the cases where we can use both (e.g. environment variables), document consistently and only use comma-separated in the cases where only it works (e.g. arguments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, fine with me. I'll try to look into it.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This allows users to set
HOMEBREW_NO_CLEANUP_FORMULAE
to acomma-separated list of formula that
brew
will refuse to clean withbrew cleanup
.We currently allow a less granular version of this with
HOMEBREW_NO_INSTALL_CLEANUP
. All this changes is how much controlusers have over what is and isn't cleaned.
Fixes #11924.